This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
67 lines (59 loc) · 1.96 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: "3.8"
services:
nginx:
build:
context: nginx
image: apiweb-nginx
depends_on:
- 'django'
restart: unless-stopped
volumes:
- ${APIWEB_STORAGE-./storage/}certbot/conf:/etc/letsencrypt
- ${APIWEB_STORAGE-./storage/}certbot/www:/var/www/certbot
- ${APIWEB_STORAGE-./storage/}django/media:/var/www/apiweb/media
- ${APIWEB_STORAGE-./storage/}django/static:/var/www/apiweb/static
ports:
- "80:80"
- "443:443"
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
volumes:
- ${APIWEB_STORAGE-./storage/}certbot/conf:/etc/letsencrypt
- ${APIWEB_STORAGE-./storage/}certbot/www:/var/www/certbot
restart: unless-stopped
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
mariadb:
image: mariadb:10.7
environment:
- MYSQL_ROOT_PASSWORD=${APIWEB_MYSQL_ROOT_PASSWORD-secret}
- MYSQL_USER=${APIWEB_MYSQL_USER-dbuser}
- MYSQL_PASSWORD=${APIWEB_MYSQL_PASSWORD-dbpassword}
- MYSQL_DATABASE=${APIWEB_MYSQL_DATABASE-apiweb}
volumes:
- ${APIWEB_STORAGE-./storage/}mariadb:/var/lib/mysql
restart: unless-stopped
django:
build:
context: .
image: apiweb
environment:
DJANGO_SETTINGS_MODULE: apiweb.settings
DJANGO_ENV_FILE: apiweb/settings/.env
depends_on:
- 'mariadb'
volumes:
- .:/app
- ./apiweb/settings/.env:/app/apiweb/settings/.env:ro
- ${APIWEB_STORAGE-./storage/}django/log:/app/log:rw
- ${APIWEB_STORAGE-./storage/}django/media:/app/apiweb/media:rw
- ${APIWEB_STORAGE-./storage/}django/static:/app/apiweb/static:rw
restart: unless-stopped
command: ['uwsgi', '--ini', 'uwsgi/apiweb.ini']
redis:
image: redis:alpine
restart: unless-stopped
command: 'redis-server ${REDIS_PASSWORD-}'
networks:
default:
name: apiweb