# Joplin



## Joplin server

#### Docker:

`docker-compose.yaml`

```yaml
version: '3'

services:
    db:
        image: postgres:13.1
        ports:
            - "5432:5432"
        restart: unless-stopped
        volumes:
            - /Users/bruno/Documents/docker/joplin-data:/var/lib/postgresql/data
        environment:
            - APP_PORT=22300
            - POSTGRES_PASSWORD=joplin
            - POSTGRES_USER=joplin
            - POSTGRES_DB=joplin
    app:
        image: joplin/server:latest
        depends_on:
            - db
        ports:
            - "22300:22300"
        restart: unless-stopped
        environment:
            - APP_BASE_URL=https://silverbook.local/joplin
            - DB_CLIENT=pg
            - POSTGRES_PASSWORD=joplin
            - POSTGRES_DATABASE=joplin
            - POSTGRES_USER=joplin
            - POSTGRES_PORT=5432
            - POSTGRES_HOST=db

```



#### Apache:

Activer les modules dans`httpd.conf`

```http
LoadModule proxy_html_module lib/httpd/modules/mod_proxy_html.so
LoadModule proxy_module lib/httpd/modules/mod_proxy.so
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
LoadModule ssl_module lib/httpd/modules/mod_ssl.so
LoadModule vhost_alias_module lib/httpd/modules/mod_vhost_alias.so
```

Editer le fichier`httpd-vhosts.conf`

```http
<VirtualHost *:443>
    DocumentRoot "/Users/bruno/Sites"
    ServerName silverbook.local
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
		ProxyPass "/joplin" http://localhost:22300
		ProxyPassReverse "/joplin" http://localhost:22300
    ProxyPreserveHost On
    ProxyRequests off
    SSLEngine on
    SSLProxyEngine On
    SSLCertificateFile "/usr/local/etc/httpd/server.crt"
    SSLCertificateKeyFile "/usr/local/etc/httpd/server.key"
</VirtualHost>
```

<u>Joplin server</u> sera accessible à https://silverbook.local/joplin



Pour rendre <u>Joplin server</u> disponible à https://joplin.silverbook.local, modifier le fichier`httpd-vhosts.conf`

```http
<VirtualHost *:443>
		...
    ServerName joplin.silverbook.local
		ProxyPass "/" http://localhost:22300
		ProxyPassReverse "/" http://localhost:22300
		...
</VirtualHost>
```

et le fichier `docker-compose.yaml`

```yaml
- APP_BASE_URL=https://joplin.silverbook.local
```

