-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompose.yaml
More file actions
97 lines (93 loc) · 2.58 KB
/
compose.yaml
File metadata and controls
97 lines (93 loc) · 2.58 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
name: ctf_platform
services:
mongo:
image: mongo:8.0
container_name: mongodb
restart: always
# Uncomment this to connect to the db (exposed to the host)
#ports:
# - "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
volumes:
- mongo-data:/data/db
- mongo-config:/data/configdb
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ctf-network
docker-socket-proxy:
container_name: dockerproxy
# Uncomment the following ports section for development
# ports:
# - "2375:2375"
environment:
- CONTAINERS=1 # create/start/stop/inspect containers
- POST=1 # CRITICAL: allow POST requests
- IMAGES=1 # read image info (needed for Image parameter)
- NETWORKS=1 # needed for NetworkMode in HostConfig
- INFO=0 # not needed
- EXEC=0 # not needed
- VOLUMES=0 # not needed
- SYSTEM=0 # not needed
- BUILD=0 # not needed
- COMMIT=0 # not needed
- CONFIGS=0 # not needed
- DISTRIBUTION=0 # not needed
- SECRETS=0 # not needed
- SERVICES=0 # not needed
- SWARM=0 # not needed
- TASKS=0 # not needed
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
image: tecnativa/docker-socket-proxy
networks:
- ctf-network
app:
build:
context: ./backend
dockerfile: dockerfile
target: production
container_name: ctf-backend
restart: unless-stopped
# you don't really need to Uncomment this because you will use npm run dev
# ports:
# - "${PORT:-3000}:3000"
volumes:
- ./backend/src/utils/ca.pem:/app/dist/utils/key.pem:ro
env_file:
- ./backend/.env
networks:
- ctf-network
depends_on:
docker-socket-proxy:
condition: service_started
mongo:
condition: service_healthy
app-frontend:
build:
context: ./frontend/
dockerfile: Dockerfile
target: production
container_name: ctf-frontend
restart: unless-stopped
# this need to access to frontend
ports:
- "8080:80"
# to be honest we don't really have env for frontend
#env_file:
#- ..frontend/
networks:
- ctf-network
depends_on:
- app
networks:
ctf-network:
driver: bridge
volumes:
mongo-data:
mongo-config: