Created
February 22, 2021 06:29
-
-
Save plamola/a8f2d700435b9155d8dc4b14f25ab793 to your computer and use it in GitHub Desktop.
Example docker-compose file to run Joplin server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
app: | |
environment: | |
- APP_BASE_URL=https://subdomain.example.com | |
- APP_PORT=22300 | |
- POSTGRES_PASSWORD=joplin | |
- POSTGRES_DATABASE=joplin | |
- POSTGRES_USER=joplin | |
- POSTGRES_PORT=5432 | |
- POSTGRES_HOST=db | |
- DB_CLIENT=pg | |
restart: unless-stopped | |
image: florider89/joplin-server:latest | |
networks: | |
- internal | |
- web | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.joplin.rule=Host(`subdomain.example.com`)" | |
- "traefik.http.routers.joplin.entrypoints=websecure" | |
- "traefik.http.routers.joplin.tls=true" | |
- "traefik.http.routers.joplin.tls.certresolver=lets-encrypt" | |
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto = http" | |
- "traefik.http.routers.joplin.service=joplin-server" | |
- "traefik.http.services.joplin-server.loadbalancer.passhostheader=true" | |
- "traefik.http.services.joplin-server.loadbalancer.server.port=22300" | |
- "traefik.docker.network=web" | |
db: | |
restart: unless-stopped | |
image: postgres:13.1 | |
networks: | |
- internal | |
volumes: | |
- /var/postgresql/joplin-data:/var/lib/postgresql/data | |
environment: | |
- POSTGRES_PASSWORD=joplin | |
- POSTGRES_USER=joplin | |
- POSTGRES_DB=joplin | |
pgbackups: | |
container_name: pgbackup | |
image: prodrigestivill/postgres-backup-local | |
restart: always | |
volumes: | |
- /server/backup:/backups | |
links: | |
- db:db | |
depends_on: | |
- db | |
networks: | |
- internal | |
environment: | |
- POSTGRES_HOST=db | |
- POSTGRES_DB=joplin | |
- POSTGRES_USER=joplin | |
- POSTGRES_PASSWORD=joplin | |
- POSTGRES_EXTRA_OPTS=-Z9 --schema=public --blobs | |
- SCHEDULE=@daily | |
- BACKUP_KEEP_DAYS=7 | |
- BACKUP_KEEP_WEEKS=4 | |
- BACKUP_KEEP_MONTHS=6 | |
- HEALTHCHECK_PORT=81 | |
networks: | |
internal: | |
internal: true | |
web: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What would make this really helpful for people who don't do this stuff for a living is a companion configuration for traefik which would work with this one to produce a relatively simple environment in which the joplin server as simple to access.