-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
133 lines (125 loc) · 2.92 KB
/
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
133
version: '3'
services:
### Nginx reverse proxy
# Also, allow us to fake a same origin API/FRONT, to be closer of production environment
nginx:
image: nginx
# build: ./compose/nginx
container_name: polypong_nginx
volumes:
- "./compose/nginx/templates/nginx.conf:/etc/nginx/templates/default.conf.template"
- "./compose/nginx/entrypoint/:/docker-entrypoint.d/${DOMAIN_NAME:-localhost}"
ports:
- "${EXPOSED_PORT_RANGE:-443}:${PORT_RANGE:-443}"
environment:
- NGINX_SSL_PORT=${PORT_RANGE:-443}
- DOMAIN_NAME=${DOMAIN_NAME:-localhost}
- SSL_PATH=/etc/ssl/certs/${DOMAIN_NAME:-localhost}
logging:
driver: none
networks:
- proxy
depends_on:
- api
- front
# Front end server for development, should not exist in production version
# Built on top of Quasar
front:
build:
context: apps/front
target: build
image: polypong/front
container_name: polypong_front
expose:
- 9000
volumes:
- ./apps/front:/app/
- "/app/node_modules"
networks:
- proxy
env_file:
- .env
working_dir: /app
entrypoint: yarn start
stop_signal: SIGINT
# Api, built on top of NestJS
api:
build:
context: apps/api
image: polypong/api
container_name: polypong_api
volumes:
- ./apps/api:/app/
- "/app/uploads"
- "/app/node_modules"
expose:
- 3000
env_file:
- .env
environment:
- NODE_ENV:production
working_dir: /app
entrypoint: yarn start
networks:
- database
- proxy
- mailer
# - redis
depends_on:
postgres:
condition: service_healthy
stop_signal: SIGINT
# Cold data (user infos, accounts etc) database
postgres:
container_name: polypong_database
image: postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_HOST: ${POSTGRES_HOST}
expose:
- 5432
networks:
- database
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
stop_signal: SIGINT
volumes: [ 'database:/var/lib/postgresql/data' ]
logging:
driver: none
# Hot data (passport session, pong game state, caching) database
# redis:
# container_name: redis
# image: redis
# restart: always
# expose:
# - 6379
# networks:
# - redis
# volumes: [ 'redis:/data' ]
# stop_signal: SIGINT
# Smtp with UI, to see all emails sent across our stack
mailhog:
container_name: polypong_mailhog
image: mailhog/mailhog
networks:
- mailer
expose:
- 1025
restart: always
stop_signal: SIGINT
logging:
driver: none
networks:
database:
proxy:
mailer:
# redis:
volumes:
database:
# redis: