-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (82 loc) · 2.35 KB
/
docker-compose.yml
File metadata and controls
86 lines (82 loc) · 2.35 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
services:
xgen-frontend:
build:
context: .
dockerfile: Dockerfile
args:
FRONTEND_REPO: ${FRONTEND_REPO:-http://gitlab.x2bee.com/tech-team/ai-team/xgen/xgen-frontend.git}
FRONTEND_BRANCH: ${FRONTEND_BRANCH:-main}
USE_LOCAL_SOURCE: ${USE_LOCAL_SOURCE:-false}
BUILD_DATE: ${BUILD_DATE:-}
GIT_COMMIT: ${GIT_COMMIT:-}
image: xgen-frontend:${IMAGE_TAG:-latest}
container_name: xgen-frontend
ports:
- "${HOST_PORT:-3000}:3000"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_BACKEND_HOST=${NEXT_PUBLIC_BACKEND_HOST:-http://localhost}
- NEXT_PUBLIC_BACKEND_PORT=${NEXT_PUBLIC_BACKEND_PORT:-8000}
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- xgen-network
# Local source build (uses frontend/ folder)
# docker-compose --profile local up xgen-frontend-local
xgen-frontend-local:
profiles:
- local
build:
context: .
dockerfile: Dockerfile
args:
USE_LOCAL_SOURCE: "true"
BUILD_DATE: ${BUILD_DATE:-}
GIT_COMMIT: ${GIT_COMMIT:-}
image: xgen-frontend:local
container_name: xgen-frontend-local
ports:
- "${HOST_PORT:-3000}:3000"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_BACKEND_HOST=${NEXT_PUBLIC_BACKEND_HOST:-http://localhost}
- NEXT_PUBLIC_BACKEND_PORT=${NEXT_PUBLIC_BACKEND_PORT:-8000}
restart: unless-stopped
networks:
- xgen-network
# Development mode with hot reload
# docker-compose --profile dev up xgen-frontend-dev
xgen-frontend-dev:
profiles:
- dev
build:
context: .
dockerfile: Dockerfile.dev
container_name: xgen-frontend-dev
ports:
- "${HOST_PORT:-3000}:3000"
environment:
- NODE_ENV=development
- NEXT_PUBLIC_BACKEND_HOST=${NEXT_PUBLIC_BACKEND_HOST:-http://localhost}
- NEXT_PUBLIC_BACKEND_PORT=${NEXT_PUBLIC_BACKEND_PORT:-8000}
volumes:
- ./frontend:/app/frontend:delegated
- frontend_node_modules:/app/frontend/node_modules
restart: unless-stopped
networks:
- xgen-network
networks:
xgen-network:
driver: bridge
volumes:
frontend_node_modules: