92 lines
2.4 KiB
YAML
92 lines
2.4 KiB
YAML
---
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: beanscore-postgres
|
|
environment:
|
|
POSTGRES_DB: beanscore
|
|
POSTGRES_USER: beanscore
|
|
POSTGRES_PASSWORD: beanscore123
|
|
ports: ["5432:5432"]
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U beanscore"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- beanscore-network
|
|
|
|
db-init:
|
|
container_name: db-init
|
|
image: postgres:16-alpine
|
|
environment:
|
|
PGPASSWORD: beanscore123
|
|
volumes:
|
|
- "./backend/src/main/docker/init.sql:/init.sql:ro"
|
|
command: >
|
|
bash -c "
|
|
echo 'Waiting for database to be ready...' &&
|
|
until pg_isready -h beanscore-postgres -U beanscore; do
|
|
echo 'Database not ready, waiting...';
|
|
sleep 2;
|
|
done &&
|
|
echo 'Database ready, running init script...' &&
|
|
psql -h beanscore-postgres -U beanscore -d beanscore -f /init.sql &&
|
|
echo 'Database initialization complete!'
|
|
"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: on-failure
|
|
networks:
|
|
- beanscore-network
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- BUILD=nightly-local
|
|
container_name: beanscore-backend
|
|
image: ghcr.io/rmcampos/bean-score/backend:backend-latest
|
|
ports: ["8080:8080"]
|
|
environment:
|
|
QUARKUS_PROFILE: prod
|
|
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://postgres:5432/beanscore
|
|
QUARKUS_DATASOURCE_USERNAME: beanscore
|
|
QUARKUS_DATASOURCE_PASSWORD: beanscore123
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/q/health/ready"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 5s
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
db-init:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- beanscore-network
|
|
|
|
frontend:
|
|
build:
|
|
context: ./app
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- VITE_BACKEND_SERVER=http://173.212.247.62:8080
|
|
- VITE_DEBUG_MAPS=true
|
|
- VITE_GOOGLE_MAPS_API_KEY=${VITE_GOOGLE_MAPS_API_KEY}
|
|
container_name: beanscore-frontend
|
|
image: ghcr.io/rmcampos/bean-score/app:app-latest
|
|
ports: ["5173:80"]
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- beanscore-network
|
|
|
|
networks:
|
|
beanscore-network:
|
|
driver: bridge
|