2021-03-21 23:36:35 +00:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
services:
|
|
|
|
nginx:
|
|
|
|
image: nginx:alpine
|
|
|
|
depends_on:
|
|
|
|
- php
|
|
|
|
restart: always
|
|
|
|
tty: false
|
|
|
|
ports:
|
|
|
|
- "80:80"
|
|
|
|
- "443:443"
|
|
|
|
volumes:
|
|
|
|
# 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
|
2021-12-20 20:39:54 +00:00
|
|
|
# social
|
2021-03-21 23:36:35 +00:00
|
|
|
- ./public:/var/www/social/public
|
|
|
|
env_file:
|
|
|
|
- ./docker/bootstrap/bootstrap.env
|
|
|
|
- ./docker/db/db.env
|
|
|
|
command: /bin/sh -c '/var/nginx/domain.sh;
|
|
|
|
while :; do
|
|
|
|
sleep 6h & wait $${!};
|
|
|
|
nginx -s reload;
|
|
|
|
done &
|
|
|
|
nginx -g "daemon off;"'
|
2021-03-31 10:55:53 +01:00
|
|
|
|
2021-03-21 23:36:35 +00:00
|
|
|
certbot:
|
|
|
|
image: certbot/certbot
|
|
|
|
# Check for certificate renewal every 12h as
|
|
|
|
# recommended by Let's Encrypt
|
|
|
|
entrypoint: /bin/sh -c 'trap exit TERM;
|
|
|
|
while :; do
|
|
|
|
certbot renew > /dev/null;
|
2021-03-31 10:55:53 +01:00
|
|
|
sleep 12h & wait $${!};
|
2021-03-21 23:36:35 +00:00
|
|
|
done'
|
|
|
|
volumes:
|
|
|
|
- ./docker/certbot/www:/var/www/certbot
|
|
|
|
- ./docker/certbot/.files:/etc/letsencrypt
|
2021-03-31 10:55:53 +01:00
|
|
|
|
2021-03-21 23:36:35 +00:00
|
|
|
php:
|
2021-12-20 20:39:54 +00:00
|
|
|
image: gsocial/php
|
2021-03-21 23:36:35 +00:00
|
|
|
restart: always
|
|
|
|
tty: true
|
|
|
|
ports:
|
|
|
|
- 9000:9000
|
|
|
|
volumes:
|
|
|
|
# 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
|
2021-12-20 20:39:54 +00:00
|
|
|
- /var/www/social/docker # exclude docker folder
|
2021-03-21 23:36:35 +00:00
|
|
|
env_file:
|
|
|
|
- ./docker/social/social.env
|
|
|
|
- ./docker/db/db.env
|
|
|
|
command: /entrypoint.sh
|
2021-03-31 10:55:53 +01:00
|
|
|
|
2021-03-21 23:36:35 +00:00
|
|
|
db:
|
2021-03-31 10:55:53 +01:00
|
|
|
image: postgres:alpine
|
2021-03-21 23:36:35 +00:00
|
|
|
restart: always
|
|
|
|
tty: false
|
|
|
|
ports:
|
2021-12-20 20:39:54 +00:00
|
|
|
- 5432:5432
|
|
|
|
environment:
|
|
|
|
- PGDATA=/var/lib/postgres/data
|
2021-03-21 23:36:35 +00:00
|
|
|
env_file:
|
|
|
|
- ./docker/db/db.env
|
2021-12-20 20:39:54 +00:00
|
|
|
volumes:
|
|
|
|
- database:/var/lib/postgres/data
|
2021-03-31 10:55:53 +01:00
|
|
|
|
2021-03-21 23:36:35 +00:00
|
|
|
redis:
|
|
|
|
image: redis:alpine
|
|
|
|
restart: always
|
|
|
|
tty: false
|
2021-12-20 20:39:54 +00:00
|
|
|
volumes:
|
|
|
|
- ./docker/redis/redis.conf:/etc/redis/redis.conf
|
2021-03-21 23:36:35 +00:00
|
|
|
ports:
|
|
|
|
- 6379:6379
|
2021-12-20 20:39:54 +00:00
|
|
|
command: redis-server /etc/redis/redis.conf
|
2021-03-31 10:55:53 +01:00
|
|
|
|
2021-12-20 20:39:54 +00:00
|
|
|
worker:
|
|
|
|
image: gsocial/php
|
|
|
|
restart: always
|
|
|
|
tty: true
|
2021-03-21 23:36:35 +00:00
|
|
|
volumes:
|
2021-12-20 20:39:54 +00: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
|
2022-10-20 10:34:43 +01:00
|
|
|
- ./docker/worker/worker.sh:/var/entrypoint.d/social_worker.sh
|
2021-12-20 20:39:54 +00:00
|
|
|
# Main files
|
|
|
|
- .:/var/www/social
|
|
|
|
- /var/www/social/docker # exclude docker folder
|
|
|
|
env_file:
|
|
|
|
- ./docker/social/social.env
|
|
|
|
- ./docker/db/db.env
|
|
|
|
command: /entrypoint.sh
|
|
|
|
|
2021-03-31 10:55:53 +01:00
|
|
|
volumes:
|
|
|
|
database:
|