Skip to content

Instantly share code, notes, and snippets.

@plamola
Created February 22, 2021 06:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plamola/a8f2d700435b9155d8dc4b14f25ab793 to your computer and use it in GitHub Desktop.
Save plamola/a8f2d700435b9155d8dc4b14f25ab793 to your computer and use it in GitHub Desktop.
Example docker-compose file to run Joplin server
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
@seatrout
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment