2020-03-01 20:51:14 +00:00
|
|
|
version: '3.3'
|
|
|
|
|
|
|
|
services:
|
|
|
|
nginx:
|
2020-05-06 13:04:59 +01:00
|
|
|
image: nginx:alpine
|
2020-05-05 02:23:55 +01:00
|
|
|
depends_on:
|
|
|
|
- php
|
2020-03-01 20:51:14 +00:00
|
|
|
restart: always
|
|
|
|
tty: false
|
|
|
|
ports:
|
|
|
|
- 80:80
|
|
|
|
- 443:443
|
|
|
|
volumes:
|
2020-05-06 13:04:59 +01:00
|
|
|
# Nginx
|
|
|
|
- ./docker/nginx/nginx.conf:/var/nginx/social.conf
|
|
|
|
- ./docker/nginx/domain.sh:/var/nginx/domain.sh
|
|
|
|
# Certbot
|
|
|
|
- ./docker/certbot/www:/var/www/certbot
|
2020-07-10 16:03:19 +01:00
|
|
|
- ./docker/certbot/.files:/etc/letsencrypt
|
2020-05-06 13:04:59 +01:00
|
|
|
# Social
|
2020-05-05 02:23:55 +01:00
|
|
|
- ./public:/var/www/social/public
|
2020-05-06 13:04:59 +01:00
|
|
|
env_file:
|
|
|
|
- ./docker/bootstrap/bootstrap.env
|
|
|
|
- ./docker/db/db.env
|
|
|
|
command: /bin/sh -c '/var/nginx/domain.sh;
|
|
|
|
while :; do
|
|
|
|
sleep 6h & wait $${!};
|
2020-05-05 02:23:55 +01:00
|
|
|
nginx -s reload;
|
|
|
|
done &
|
|
|
|
nginx -g "daemon off;"'
|
|
|
|
|
2020-05-10 22:33:03 +01:00
|
|
|
certbot:
|
|
|
|
image: certbot/certbot
|
|
|
|
depends_on:
|
|
|
|
- nginx
|
|
|
|
# Check for certificate renewal every 12h as
|
|
|
|
# recomnended by Let's Encryot
|
|
|
|
entrypoint: /bin/sh -c 'trap exit TERM;
|
|
|
|
while :; do
|
|
|
|
certbot renew > /dev/null;
|
|
|
|
sleep 12h & wait $${!};
|
|
|
|
done'
|
|
|
|
volumes:
|
|
|
|
- ./docker/certbot/www:/var/www/certbot
|
2020-07-10 16:03:19 +01:00
|
|
|
- ./docker/certbot/.files:/etc/letsencrypt
|
2020-03-01 20:51:14 +00:00
|
|
|
|
|
|
|
php:
|
|
|
|
build: docker/php
|
2020-05-05 02:23:55 +01:00
|
|
|
depends_on:
|
|
|
|
- db
|
2020-03-01 20:51:14 +00:00
|
|
|
restart: always
|
|
|
|
tty: true
|
|
|
|
ports:
|
|
|
|
- 9000:9000
|
|
|
|
volumes:
|
2020-05-05 02:23:55 +01:00
|
|
|
# Entrypoint
|
|
|
|
- ./docker/php/entrypoint.sh:/entrypoint.sh
|
|
|
|
- ./docker/db/wait_for_db.sh:/wait_for_db.sh
|
|
|
|
- ./docker/social/install.sh:/var/entrypoint.d/social_install.sh
|
|
|
|
# Main files
|
|
|
|
- .:/var/www/social
|
2020-05-06 13:04:59 +01:00
|
|
|
env_file:
|
2020-05-05 02:23:55 +01:00
|
|
|
- ./docker/social/social.env
|
|
|
|
- ./docker/db/db.env
|
|
|
|
command: /entrypoint.sh
|
2020-03-01 20:51:14 +00:00
|
|
|
|
2020-05-05 02:23:55 +01:00
|
|
|
db:
|
2020-03-01 20:51:14 +00:00
|
|
|
image: postgres:alpine
|
|
|
|
restart: always
|
|
|
|
tty: false
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
environment:
|
2020-05-14 22:55:45 +01:00
|
|
|
- PGDATA=/var/lib/postgres/data
|
2020-05-05 02:23:55 +01:00
|
|
|
env_file:
|
|
|
|
- ./docker/db/db.env
|
2020-03-01 20:51:14 +00:00
|
|
|
volumes:
|
2020-05-14 22:55:45 +01:00
|
|
|
- database:/var/lib/postgres/data
|
2020-03-01 20:51:14 +00:00
|
|
|
|
2020-07-17 23:58:45 +01:00
|
|
|
redis:
|
|
|
|
image: redis:alpine
|
|
|
|
restart: always
|
|
|
|
tty: false
|
|
|
|
ports:
|
2020-11-02 20:04:16 +00:00
|
|
|
- 6379:6379
|
2020-10-27 11:21:10 +00:00
|
|
|
|
|
|
|
mail:
|
2020-11-02 20:04:16 +00:00
|
|
|
build: docker/mail
|
|
|
|
env_file:
|
2020-11-07 17:43:25 +00:00
|
|
|
- ./docker/mail/mail.env
|
2020-11-02 20:04:16 +00:00
|
|
|
ports:
|
|
|
|
- 25:25
|
2020-11-22 19:14:59 +00:00
|
|
|
- 110:110
|
2020-11-02 20:04:16 +00:00
|
|
|
- 143:143
|
|
|
|
- 587:587
|
|
|
|
- 993:993
|
|
|
|
volumes:
|
2020-11-07 17:43:25 +00:00
|
|
|
- ./docker/mail/mail:/var/mail
|
|
|
|
- ./docker/mail/config:/etc/mail
|
2020-11-02 20:04:16 +00:00
|
|
|
# Certbot
|
|
|
|
- ./docker/certbot/www:/var/www/certbot
|
|
|
|
- ./docker/certbot/.files:/etc/letsencrypt
|
|
|
|
|
2020-03-01 20:51:14 +00:00
|
|
|
volumes:
|
|
|
|
database:
|