-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-dev.yml
More file actions
80 lines (77 loc) · 1.77 KB
/
docker-compose-dev.yml
File metadata and controls
80 lines (77 loc) · 1.77 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
services:
db:
image: postgres:15
container_name: tisc-db
userns_mode: "host"
environment:
POSTGRES_USER: tisc_user
POSTGRES_PASSWORD: qaywsxedc
POSTGRES_DB: tisc_db
ports:
- "5433:5432"
networks:
- tisc-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tisc_user -d tisc_db"]
interval: 5s
timeout: 5s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: tisc-app
userns_mode: "host"
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
restart: always
ports:
- "3000:3000"
volumes:
- ./app:/app
- /app/node_modules
- ./.git:/app/.git:ro
networks:
- tisc-network
environment:
- DATABASE_URL=postgresql://tisc_user:qaywsxedc@db:5432/tisc_db
- GITHUB_TOKEN=${GITHUB_TOKEN}
- AUTH_SECRET=${AUTH_SECRET}
command: >
sh -c "
git config --global --add safe.directory /app &&
bun install &&
bun x prisma generate &&
bun x prisma db push &&
bun dev
"
deploy:
resources:
limits:
cpus: '1.0' # Limit to 1 CPU core
memory: 1.5G # If request > 1.5Go, the container will be killed
reservations:
memory: 512M
test:
image: cypress/included:13.15.0
container_name: tisc_test
userns_mode: "host"
depends_on:
app:
condition: service_healthy
volumes:
- ./:/opt/app
working_dir: /opt/app
networks:
- tisc-network
environment:
- CYPRESS_baseUrl=http://app:3000
networks:
tisc-network:
driver: bridge