-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
53 lines (51 loc) · 1.46 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
services:
database:
container_name: db-lab
image: postgres
volumes:
- db-data:/var/lib/postgresql/data
- ./backend/src/database/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
- POSTGRES_PASSWORD=${PG_PASSWORD}
- POSTGRES_DB=${PG_DB}
- POSTGRES_USER=${PG_USER}
ports:
- 5432:5432
backend:
container_name: backend-lab
image: rust:latest
environment:
- SOCKET_IP=${SOCKET_IP}
- SOCKET_PORT=${SOCKET_PORT}
- DATABASE_URL=${DATABASE_URL}
volumes:
- "./backend:/app"
working_dir: /app
command: bash -c "curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && cargo binstall -y cargo-watch && cargo watch -x run"
frontend:
container_name: frontend-lab
image: node:18
volumes:
- "./frontend:/app"
- ./deploy/.env:/app/.env
working_dir: /app
command: bash -c "rm -rf lab-control/dist/ && npm --prefix lab-control install && npm --prefix lab-control run build && npm i -g vite && yarn install && vite"
web:
container_name: web
image: nginx
depends_on:
- backend
- frontend
- database
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./pem:/pem
ports:
- "8001:443"
environment:
- NGINX_HOST=someweb.com
- NGINX_PORT=80
volumes:
db-data:
external: true
name: ${VOLUME_NAME}