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
|
|
|
|
- ./docker/certbot/files:/etc/letsencrypt
|
|
|
|
# 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
|
|
|
|
- ./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
|
|
|
|
|
|
|
volumes:
|
|
|
|
database:
|