Skip to content

Instantly share code, notes, and snippets.

@rcludwick
Last active July 14, 2018 03:14
Show Gist options
  • Save rcludwick/adf58480fa2baf8db7861afee4c9ba78 to your computer and use it in GitHub Desktop.
Save rcludwick/adf58480fa2baf8db7861afee4c9ba78 to your computer and use it in GitHub Desktop.
Rob's nginx seafile docker compose.yml
version: "2"
networks:
default:
proxy:
services:
nginx:
restart: always
image: nginx:alpine
container_name: nginx
ports:
- 80:80
- 443:443
volumes:
- /etc/nginx/conf.d
- /etc/nginx/vhost.d
- /usr/share/nginx/html
- ./volumes/proxy/certs:/etc/nginx/certs:ro
- ./volumes/proxy/extra/client_body_size.conf:/etc/nginx/conf.d/client_body_size.conf:ro
networks:
- default
- proxy
nginx-gen:
restart: always
image: jwilder/docker-gen
container_name: nginx-gen
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./volumes/proxy/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
volumes_from:
- nginx
depends_on:
- nginx
networks:
- proxy
entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
letsencrypt-nginx-proxy-companion:
restart: always
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt-nginx-proxy-companion
volumes_from:
- nginx
depends_on:
- nginx
- nginx-gen
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./volumes/proxy/certs:/etc/nginx/certs:rw
environment:
- NGINX_DOCKER_GEN_CONTAINER=nginx-gen
version: '2'
services:
seafile:
restart: always
ports:
- 8888:8888
environment:
- SEAFILE_URL=https://your.external.hostname.com
- VIRTUAL_HOST=your.external.hostname.com
- VIRTUAL_PORT=8888
- LETSENCRYPT_HOST=your.external.hostname.com
- LETSENCRYPT_EMAIL=your-emailgmail.com
volumes:
- /your/storage/path/to/seafile:/seafile
networks:
- default
- nginxgen_proxy
mysql:
restart: always
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=
- MYSQL_ROOT_PASSWORD=YOUR_MYSQL_RANDOM_PASSWORD
volumes:
- /your/storage/path/to/seafile-db/mysql:/var/lib/mysql
networks:
- default
# Optional ddclient config
ddclient:
restart: always
volumes:
- ./ddclient/config:/config
environment:
- PGID=1000
- PUID=1000
networks:
- default
networks:
nginxgen_proxy:
external: true
version: '2'
services:
seafile:
build: .
links:
- mysql
volumes:
- seafile:/seafile
mysql:
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
volumes:
- mysql:/var/lib/mysql
image: mysql:5.7
ddclient:
image: linuxserver/ddclient:latest
volumes:
mysql:
driver: local
seafile:
driver: local
ddclient:
driver: local
--- a/etc/nginx/sites-available/seafile.conf
+++ b/etc/nginx/sites-available/seafile.conf
@@ -1,6 +1,6 @@
server {
- listen 80;
- server_name "";
+ listen 8888;
+ server_name _;
location / {
fastcgi_pass 127.0.0.1:8000;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment