Skip to content

Instantly share code, notes, and snippets.

@joelhans
Last active November 13, 2018 21:25
Show Gist options
  • Save joelhans/f9ada0a9f8ca207ccdba0a2d02e4ffc8 to your computer and use it in GitHub Desktop.
Save joelhans/f9ada0a9f8ca207ccdba0a2d02e4ffc8 to your computer and use it in GitHub Desktop.
My self-hosting `docker-compose.yml` file. To use, 1) set up your DNS, 2) replace domain/email fields, 3) execute `docker-compose up -d`. Should work.
version: '2'
services:
portainer:
image: portainer/portainer
container_name: portainer
restart: always
environment:
- VIRTUAL_HOST=docker.DOMAIN.TLD
- LETSENCRYPT_HOST=docker.DOMAIN.TLD
- [email protected]
volumes:
- ./portainer/:/data
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "9000:9000"
freshrss:
image: linuxserver/freshrss
container_name: freshrss
restart: unless-stopped
environment:
- VIRTUAL_HOST=feed.DOMAIN.TLD
- LETSENCRYPT_HOST=feed.DOMAIN.TLD
- [email protected]
- PGID=1001
- PUID=1000
volumes:
- ./freshrss:/config
ports:
- "667:80"
networks:
- proxy-tier
- default
gitea:
image: gitea/gitea:latest
container_name: gitea
restart: unless-stopped
environment:
- VIRTUAL_HOST=gitea.DOMAIN.TLD
- LETSENCRYPT_HOST=gitea.DOMAIN.TLD
- [email protected]
- USER_UID=1000
- USER_GID=1000
- ROOT_URL=https://gitea.DOMAIN.TLD
- DOMAIN=gitea.DOMAIN.TLD
- PROTOCOL=http
- VIRTUAL_PORT=3000
volumes:
- ./gitea:/data
ports:
- "5000:3000"
- "222:22"
networks:
- proxy-tier
- default
nextcloud:
image: nextcloud:apache
container_name: nextcloud
restart: unless-stopped
environment:
- VIRTUAL_HOST=cloud.DOMAIN.TLD
- LETSENCRYPT_HOST=cloud.DOMAIN.TLD
- [email protected]
- PGID=999
- PUID=1000
volumes:
- ./nextcloud:/var/www/html
- ./uploadsize.conf:/etc/nginx/conf.d/uploadsize.conf
ports:
- "666:80"
networks:
- proxy-tier
- default
depends_on:
- "db"
links:
- "redis"
redis:
image: redis
container_name: redis
restart: unless-stopped
volumes:
- ./redis:/data
db:
image: mariadb
container_name: db
restart: always
environment:
MYSQL_ROOT_PASSWORD: SECRET
volumes:
- ./db:/var/lib/mysql
ports:
- "3306:3306"
proxy:
image: jwilder/nginx-proxy
container_name: proxy
restart: unless-stopped
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- certs:/etc/nginx/certs:rw
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- ./uploadsize.conf:/etc/nginx/conf.d/uploadsize.conf:ro
environment:
- DEFAULT_HOST=cloud.joelhans.com
ports:
- "80:80"
- "443:443"
networks:
- "default"
- "proxy-tier"
proxy-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
restart: unless-stopped
environment:
- NGINX_PROXY_CONTAINER=proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes_from:
- "proxy"
depends_on:
- "proxy"
networks:
- "default"
- "proxy-tier"
volumes:
certs:
vhost.d:
html:
networks:
proxy-tier:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment