generated from mi-sec/template-docker-full-stack-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
68 lines (62 loc) · 1.42 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
version: '3.8'
networks:
app_network:
driver: bridge
volumes:
ui-build:
services:
nginx:
container_name: nginx
hostname: nginx
image: nginx
ports:
- ${NGINX_PORT:-80}:80
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./app/api/storage:/usr/share/nginx/storage
- ui-build:/usr/share/nginx/html
restart: always
networks:
- app_network
api:
container_name: api
hostname: api
build:
context: ./app/api
args:
- NPM_REGISTRY=${NPM_REGISTRY:-https://registry.npmjs.org/}
- BUILD_ENV=${BUILD_ENV:-production}
- ${API_PORT:-3000}:${API_PORT:-3000}
expose:
- ${API_PORT:-3000}
volumes:
- ./app/api/config:/app/config
- ./app/api/src:/app/src
- ./app/api/storage:/app/storage
restart: always
networks:
- app_network
env_file:
- ${ENV_FILE:-./.env}
environment:
- BUILD_ENV=${BUILD_ENV:-production}
depends_on:
- nginx
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost" ]
interval: 1m30s
timeout: 10s
retries: 3
ui:
container_name: ui
build:
context: ./app/ui
args:
- NPM_REGISTRY=${NPM_REGISTRY:-https://registry.npmjs.org/}
volumes:
- ui-build:/app/build
networks:
- app_network
depends_on:
- nginx