-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
132 lines (111 loc) · 3.37 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: ufo
x-podman:
in_pod: false
networks:
ufo-internal-net:
driver: bridge
volumes:
# COMPOSE_PROJECT_NAME is automatically prefixed to the volume name by docker-compose
postgresql_data:
# Base django service which is reused in regular web worker service "django", as
# well as "django-migrate", "django-fixtures-*" db initialization services.
x-django: &base-django
image: ufo
# ADD to your ~/.bashrc file:
# export USER_ID="$(id -u)"
# export GROUP_ID="$(id -g)"
userns_mode: "auto:uidmapping=9999:@${USER_ID},gidmapping=9999:@${GROUP_ID}"
# userns_mode: "auto:uidmapping=9999:@${USER_ID},gidmapping=9999:@${GROUP_ID}"
# userns_mode: "keep-id"
# x-podman.uidmaps:
# - "9999:1001"
# - "0:0"
# x-podman.gidmaps:
# - "9999:1001"
# - "0:0"
volumes:
- ./src:/project
environment:
- DATABASE_URL=postgresql://pguser:password@postgres:5432/pgdb
- GOOGLE_OAUTH2_CLIENT_ID=testid
- GOOGLE_OAUTH2_CLIENT_SECRET=testsecret
- DJANGO_SETTINGS_MODULE=settings
- UFO_LOGLEVEL=DEBUG
networks:
- ufo-internal-net
services:
django:
<<: *base-django
build:
context: .
dockerfile: ./Dockerfile
# container_name: ufo-django
depends_on:
- postgres
# - redis
# env_file:
# - path: env-compose
# required: false
# - path: env-compose-local
# required: false
ports:
- target: 8000 # inside container
published: 8000
# entrypoint: ["sh", "-c", "pgwait && ./manage.py check --tag email --deploy && gunicorn wsgi --log-file - --bind 0.0.0.0:8000"]
entrypoint: ["sh", "-c", "pgwait && ./manage.py check --tag email --deploy && uvicorn asgi:application --host 0.0.0.0 --port 8000 --log-config=uvicorn_log_config.yml --log-level=debug"]
# command: bash
restart: on-failure
django-migrate:
<<: *base-django
depends_on:
- django
entrypoint: ["sh", "-c", "pgwait && ./manage.py migrate --skip-checks"]
django-fixtures-regions:
<<: *base-django
depends_on:
django-migrate:
condition: service_completed_successfully
entrypoint: ["sh", "-c", "pgwait && ./scripts/regions.py populatedb"]
django-fixtures-questions:
<<: *base-django
depends_on:
django-fixtures-regions:
condition: service_completed_successfully
entrypoint: ["sh", "-c", "pgwait && ./scripts/2020_ankety.py"]
# # needed only for local development - because on Linux you can't
# # access the host container in any other reliable way
# # And things like OA API are usually started separately
# docker-host:
# image: qoomon/docker-host
# cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
# restart: on-failure
# networks:
# - ufo-internal-net
postgres:
image: postgres:17.2-alpine3.21
userns_mode: "auto:uidmapping=70:@1001,gidmapping=70:@1001"
logging:
driver: none
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=pgdb
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=password
restart: on-failure
networks:
- ufo-internal-net
volumes:
- postgresql_data:/var/lib/postgresql/data
ports:
- target: 5432 # inside container
published: 5432
# redis:
# image: redis:5.0
# restart: on-failure
# logging:
# driver: none
# networks:
# - ufo-internal-net
# ports:
# - 6379:6379