diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..bdecc24 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,37 @@ +version: '3.9' +services: + db: + image: postgres:16.1-alpine + container_name: postgres + ports: + - 5432:5432 + volumes: + - ./pg_data:/var/lib/postgresql/data/pgdata + environment: + POSTGRES_DB: wallet_db + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 123 + POSTGRES_HOST_AUTH_METHOD: scram-sha-256 + POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 + PGDATA: /var/lib/postgresql/data/pgdata + healthcheck: + test: ["CMD", "pg_isready" , "-U", "postgres"] + interval: 30s + timeout: 10s + retries: 5 + restart: always + app: + image: bifurcated/wallet:latest + container_name: application + ports: + - 8000:8000 + environment: + POSTGRES_DB: wallet_db + POSTGRES_HOST: db + JAVA_OPTS: "-XX:+UseContainerSupport -XX:+UseZGC -Xmx512M -Xlog:gc" + restart: always + depends_on: + db: + condition: service_healthy + links: + - db \ No newline at end of file