-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
164 lines (154 loc) · 4 KB
/
docker-compose.yaml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
version: "3.3"
services:
# certbot:
# environment:
# SERVER_HOST: ${SERVER_HOST}
# build:
# context: ./certbot
# networks:
# - default
# ports:
# - "80:80"
# volumes:
# - /etc/localtime:/etc/localtime:ro
# - ./certbot/nginx.conf:/etc/nginx/nginx.conf
# - ./certbot/certs:/etc/letsencrypt
# - ./certbot/log:/var/log/letsencrypt
database:
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: /var/lib/postgresql/data
DB_NAME: ${DB_NAME}
build:
context: ./database
dockerfile: Dockerfile
args:
# SERVER_HOST: ${SERVER_HOST}
# SERVER_PORT: ${SERVER_PORT}
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
# DB_SCHEMA: ${DB_SCHEMA}
BACKEND_DB_USER: ${BACKEND_DB_USER}
BACKEND_DB_PASSWORD: ${BACKEND_DB_PASSWORD}
STORAGE_DB_USER: ${STORAGE_DB_USER}
STORAGE_DB_PASSWORD: ${STORAGE_DB_PASSWORD}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- default
volumes:
- /etc/localtime:/etc/localtime:ro
- db_data:/var/lib/postgresql/data
migration:
environment:
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_SCHEMA=${DB_SCHEMA}
- BACKEND_DB_USER=${BACKEND_DB_USER}
- BACKEND_DB_PASSWORD=${BACKEND_DB_PASSWORD}
- STORAGE_DB_USER=${STORAGE_DB_USER}
- STORAGE_DB_PASSWORD=${STORAGE_DB_PASSWORD}
build:
context: ./migration
networks:
- default
depends_on:
- database
volumes:
- /etc/localtime:/etc/localtime:ro
- ./migration/migrations:/migrations
# pgadmin:
# image: dpage/pgadmin4
# environment:
# PGADMIN_DEFAULT_EMAIL: [email protected]
# PGADMIN_DEFAULT_PASSWORD: root
# networks:
# - default
# ports:
# - "5050:80"
# depends_on:
# - database
frontend:
environment:
- REACT_APP_SERVER_HOST=${SERVER_HOST}
- REACT_APP_SERVER_PORT=${SERVER_PORT}
build:
context: ./frontend
networks:
- default
volumes:
- /etc/localtime:/etc/localtime:ro
- ./frontend/src:/app/src
backend:
environment:
- POSTGRES_HOST=database
- POSTGRES_LOCAL_PORT=5432
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${BACKEND_DB_USER}
- POSTGRES_PASSWORD=${BACKEND_DB_PASSWORD}
- DB_SCHEMA=${DB_SCHEMA}
- FORTYTWO_APP_ID=${FORTYTWO_APP_ID}
- FORTYTWO_APP_SECRET=${FORTYTWO_APP_SECRET}
- FORTYTWO_REDIRECT_URI=${FORTYTWO_REDIRECT_URI}
- GOOGLE_APP_ID=${GOOGLE_APP_ID}
- GOOGLE_APP_SECRET=${GOOGLE_APP_SECRET}
- GOOGLE_REDIRECT_URI=${GOOGLE_REDIRECT_URI}
- SERVER_HOST=${SERVER_HOST}
- SERVER_PORT=${SERVER_PORT}
- SESSION_SECRET=${SESSION_SECRET}
- STORAGE_HOST=storage
- STORAGE_PORT=3000
build: ./backend
networks:
- default
depends_on:
# - certbot
- database
volumes:
- /etc/localtime:/etc/localtime:ro
- ./backend/src:/app/src
- ./certbot/certs:/certs
storage:
build:
context: ./storage
networks:
- default
depends_on:
- database
volumes:
- /etc/localtime:/etc/localtime:ro
- ./storage/src:/app/src
- ./storage/public:/app/public
proxy:
environment:
- NGINX_HOST=${SERVER_HOST}
- NGINX_PORT=80
- BACKEND_HOST=backend
- BACKEND_PORT=3000
- FRONTEND_HOST=frontend
- FRONTEND_PORT=3000
- STORAGE_HOST=storage
- STORAGE_PORT=3000
image: nginx:1.21.4-alpine
networks:
- default
ports:
- "${SERVER_PORT}:80"
depends_on:
- frontend
- backend
- storage
volumes:
- /etc/localtime:/etc/localtime:ro
- ./proxy/default.conf:/etc/nginx/templates/default.conf.template:ro
volumes:
db_data:
storage_data:
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.25.0.0/16