-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
51 lines (47 loc) · 1.15 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
version: '3.8'
services:
app:
container_name: app_url_shortner_server
build:
context: .
dockerfile: ./Dockerfile
command: sh -c "npx prisma migrate deploy && npm run dev"
env_file:
- .env
restart: unless-stopped
ports:
- ${HTTP_PORT:-3030}:${HTTP_PORT:-3030}
depends_on:
db:
condition: service_healthy
volumes:
- .:/usr/app
- /usr/app/node_modules
db:
container_name: app_url_shortner_postgres
image: postgres:15-alpine
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
test_db:
container_name: app_integration_tests
image: postgres:15-alpine
restart: unless-stopped
ports:
- "5433:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
pgdata: