115 lines
2.9 KiB
YAML
115 lines
2.9 KiB
YAML
---
|
|
|
|
services:
|
|
app:
|
|
container_name: beanscore-app
|
|
image: node:22.14-bookworm-slim
|
|
ports:
|
|
- "5173:5173"
|
|
entrypoint: sh -c "npm i --no-update-notifier && npm run dev -- --host"
|
|
env_file:
|
|
- ./app/.env
|
|
environment:
|
|
VITE_BACKEND_SERVER: http://localhost:8080
|
|
VITE_BUILD: nightly
|
|
VITE_DEBUG_MAPS: true
|
|
volumes:
|
|
- "./app:/app"
|
|
working_dir: /app
|
|
healthcheck:
|
|
test: timeout 10s bash -c 'true > /dev/tcp/127.0.0.1/5173' || exit 1
|
|
interval: 1m30s
|
|
timeout: 15s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
backend:
|
|
container_name: beanscore-backend
|
|
depends_on:
|
|
postgres:
|
|
condition: service_started
|
|
environment:
|
|
POSTGRES_DB: beanscore
|
|
POSTGRES_HOST: beanscore-postgres
|
|
POSTGRES_USER: beanscore
|
|
POSTGRES_PASSWORD: beanscore123
|
|
POSTGRES_PORT: 5432
|
|
CORS_ALLOWED_ORIGINS: http://localhost:5173
|
|
ports:
|
|
- "8080:8080"
|
|
- "5005:5005"
|
|
image: maven:3.9.12-eclipse-temurin-21
|
|
entrypoint: 'mvn quarkus:dev -Dquarkus.http.host=0.0.0.0'
|
|
working_dir: /app
|
|
volumes:
|
|
- "./backend:/app"
|
|
healthcheck:
|
|
test: curl -f http://localhost:8080/q/health | grep '"status":"UP"'
|
|
interval: 1m30s
|
|
timeout: 15s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
# schemaspy:
|
|
# container_name: schemaspy
|
|
# profiles: ["schemaspy"]
|
|
# image: schemaspy/schemaspy:7.0.2
|
|
# user: ${UID:-1000}:${GID:-1000}
|
|
# volumes:
|
|
# - "./schemaspy/output:/output"
|
|
# - "./schemaspy/postgres.properties:/schemaspy.properties"
|
|
# depends_on:
|
|
# tasknote-db:
|
|
# condition: service_healthy
|
|
# backend:
|
|
# condition: service_healthy
|
|
|
|
postgres:
|
|
image: postgres:15.8-bookworm
|
|
container_name: beanscore-postgres
|
|
environment:
|
|
POSTGRES_DB: beanscore
|
|
POSTGRES_USER: beanscore
|
|
POSTGRES_PASSWORD: beanscore123
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./backend/src/main/docker/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U beanscore"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
db-init:
|
|
container_name: db-init
|
|
image: postgres:15.8-bookworm
|
|
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
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
beanscore-network:
|
|
driver: bridge
|
|
|