Last active
February 7, 2017 13:50
-
-
Save BastienM/bc1665347418653571258a06912377b8 to your computer and use it in GitHub Desktop.
untested docker-compose skeleton for web hosting using Docker
This file contains hidden or 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
| # made by /u/HellowFR, for /u/shubhank008/ Homelab subreddit | |
| version: "3" | |
| services: | |
| ftp: | |
| image: fauria/vsftpd | |
| container_name: "ftp_username" | |
| restart: always | |
| environment: | |
| FTP_USER="username" | |
| FTP_PASS="password" | |
| expose: | |
| - "20" | |
| - "21" | |
| volumes: | |
| - username-data:/home/vsftpd | |
| networks: | |
| - "username-net" | |
| labels: | |
| - "traefik.frontend.rule=Host:ftp.username.domain.tld" | |
| - "traefik.frontend.entryPoints=http,https" | |
| - "traefik.backend=ftp" | |
| - "traefik.protocol=tcp" | |
| - "traefik.port=21" | |
| - "traefik.docker.network=username-net" | |
| nginx: | |
| image: nginx:alpine | |
| container_name: "nginx_username" | |
| restart: always | |
| # see https://hub.docker.com/_/nginx/ for explanation on templating | |
| environment: | |
| - NGINX_HOST="username.tld" | |
| - NGINX_HOST="443" | |
| expose: | |
| - "80" | |
| - "443" | |
| volumes: | |
| - username-data:/var/www | |
| networks: | |
| - "username-net" | |
| labels: | |
| - "traefik.frontend.rule=Host:username.domain.tld" | |
| - "traefik.frontend.entryPoints=http,https" | |
| - "traefik.backend=nginx" | |
| - "traefik.protocol=https" | |
| - "traefik.port=443" | |
| - "traefik.docker.network=username-net" | |
| traefik: | |
| image: traefik | |
| container_name: reverse-proxy | |
| restart: always | |
| command: --web --docker --logLevel=DEBUG | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| - "20:20" | |
| - "21:21" | |
| networks: | |
| - web-net | |
| - username-net | |
| volumes: | |
| - "/var/run/docker.sock:/var/run/docker.sock" | |
| networks: | |
| username-net: | |
| driver: bridge | |
| web-net: | |
| driver: bridge | |
| volumes: | |
| username-data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment