Skip to content

Commit e25375b

Browse files
committed
fix: add db to the docker-compose.prod
1 parent abfb24a commit e25375b

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/containers-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
--file Dockerfile.prod \
6969
--tag "${DOCKER_REPOSITORY}/app:latest" \
7070
--tag "${DOCKER_REPOSITORY}/app:${DOCKER_TAG}" \
71+
--build-arg VERSION="${DOCKER_TAG}" \
7172
.
7273
7374
- name: "Push Docker container image app:latest"

docker-compose.prod.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@ name: balancer-prod
22
version: "3.8"
33

44
services:
5+
db:
6+
image: pgvector/pgvector:pg15
7+
volumes:
8+
- postgres_data_prod:/var/lib/postgresql/data/
9+
- ./db/init-vector-extension.sql:/docker-entrypoint-initdb.d/init-vector-extension.sql
10+
environment:
11+
- POSTGRES_USER=balancer
12+
- POSTGRES_PASSWORD=balancer
13+
- POSTGRES_DB=balancer_dev
14+
networks:
15+
- app_net
16+
healthcheck:
17+
test: ["CMD-SHELL", "pg_isready -U balancer -d balancer_dev"]
18+
interval: 5s
19+
timeout: 5s
20+
retries: 5
21+
522
app:
623
image: balancer-app
724
build:
@@ -11,3 +28,15 @@ services:
1128
- "8000:8000"
1229
env_file:
1330
- ./config/env/prod.env
31+
depends_on:
32+
db:
33+
condition: service_healthy
34+
networks:
35+
- app_net
36+
37+
volumes:
38+
postgres_data_prod:
39+
40+
networks:
41+
app_net:
42+
driver: bridge

0 commit comments

Comments
 (0)