-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
119 lines (112 loc) · 2.52 KB
/
docker-compose.yml
File metadata and controls
119 lines (112 loc) · 2.52 KB
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
version: '3.8'
services:
postgres:
image: postgres:15
container_name: postgres_db
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "${DB_PORT}:${DB_PORT}"
volumes:
- ./database:/var/lib/postgresql/data
# - df_postgres_data:/var/lib/postgresql/data
networks:
- df-network
env_file:
- .env
backend:
image: node:22.11.0
container_name: backend
depends_on:
- postgres
working_dir: /app
volumes:
- ./backend:/app
# - df_backend_data:/app
environment:
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
JWT_SECRET: ${JWT_SECRET}
BACKEND_PORT: ${BACKEND_PORT}
command: >
sh -c "
cd /app/ &&
npm install &&
npm run typeorm -- migration:run -d ./data-source.ts &&
npm run start:dev"
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
networks:
- df-network
env_file:
- .env
frontend:
image: node:22.11.0
container_name: frontend
depends_on:
- backend
working_dir: /app
volumes:
- ./frontend:/app
# - df_frontend_data:/app
environment:
API_URL: ${API_URL}
command: >
sh -c "
cd /app/ &&
npm cache clean --force &&
npm i &&
npm run build &&
npx serve -s dist -l tcp:0.0.0.0:${FRONTEND_PORT}"
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
networks:
- df-network
env_file:
- .env
nginx:
image: nginx:1.27.4
container_name: nginx_proxy
depends_on:
- frontend
- backend
ports:
- "${NGINX_PORT}:80"
volumes:
- ./nginx.conf.template:/etc/nginx/nginx.conf.template
- ./docker-entrypoint.sh:/docker-entrypoint.sh
environment:
FRONTEND_PORT: ${FRONTEND_PORT}
BACKEND_PORT: ${BACKEND_PORT}
entrypoint: ["/bin/sh", "/docker-entrypoint.sh"]
networks:
- df-network
env_file:
- .env
#nodered:
# image: nodered/node-red:latest
# container_name: nodered
# ports:
# - "1880:1880"
# volumes:
# - ./node-red-data:/data
# - ./settings.js:/data/settings.js # Optional: custom settings
# restart: unless-stopped
# networks:
# - df-network
# env_file:
# - .env
networks:
df-network:
driver: bridge
external: true
#volumes:
# df_postgres_data:
# df_backend_data:
# df_frontend_data: