-
Notifications
You must be signed in to change notification settings - Fork 100
/
docker-compose.yml
70 lines (62 loc) · 1.63 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
68
69
version: '3'
services:
db:
container_name: postgres
image: postgres
environment:
POSTGRES_PASSWORD: password123
# ports:
# - "5432:5432"
# (HOST:CONTAINER)
volumes:
- pgdata:/var/lib/postgresql/data/
nginx:
container_name: nginx-container
build: ./nginx
restart: always
ports:
# - "8080:80"
- "80:80"
volumes:
- api_data:/docker_api
- ./log:/var/log/nginx
- ./my_htpasswd:/my_htpasswd
depends_on:
- api
api:
container_name: api-container
build: ./api
restart: always
entrypoint: /docker_api/docker-entrypoint.sh
# command: uwsgi --emperor uwsgi.ini
command: uwsgi --ini uwsgi.ini
# ref.
# https://docs.djangoproject.com/en/3.0/ref/django-admin/#django-admin-createsuperuser
environment:
- DJANGO_SUPERUSER_USERNAME=admin
- DJANGO_SUPERUSER_PASSWORD=admin1234
# ports:
# - "8002:8000"
volumes:
- api_data:/docker_api
depends_on:
- db
# auto migrate django
# migration:
# build: ./api
# command:
# - /bin/sh
# - -c
# - |
# python manage.py collectstatic --noinput
# python manage.py migrate
# python manage.py makemigrations musics
# python manage.py migrate
# volumes:
# - api_data:/docker_api
# depends_on:
# - db
volumes:
api_data:
pgdata: