services: postgres: image: postgres:15.5 shm_size: 512mb ports: - 5435:5432 environment: PGDATA: /var/lib/pg_data POSTGRES_PASSWORD: password POSTGRES_HOST_AUTH_METHOD: trust volumes: - ./output/.pg/data/pgdata:/var/lib/pg_data healthcheck: test: ['CMD-SHELL', 'pg_isready -U postgres'] interval: 5s timeout: 5s retries: 5 migrations: build: context: ./services/migrations target: dev environment: - DATABASE_URL=postgres://postgres:password@postgres:5432/postgres volumes: - ./services/migrations/migrations:/usr/src/app/migrations - $HOME/src/harth/pgmg:/usr/src/app/node_modules/pgmg depends_on: postgres: condition: service_healthy server: build: ./services/server command: bash -c 'npm install && node run.js dev' working_dir: $PWD/services/server user: node volumes: - $PWD:$PWD - $HOME/.ssh:$HOME/.ssh environment: DATABASE_URL: postgres://zecret_api:password@postgres:5432/postgres # keeps esbuild watch running tty: true # exit node from SIGINT init: true server-tests: build: ./services/server command: bash -c 'npm install && npm run test-watch' working_dir: $PWD/services/server user: node environment: DATABASE_URL: postgres://zecret_api:password@postgres:5432/postgres TEST_DATABASE_URL: postgres://postgres:password@postgres:5432/postgres volumes: - $PWD:$PWD - $HOME/.ssh:$HOME/.ssh # keeps esbuild watch running tty: true # exit node from SIGINT init: true depends_on: migrations: condition: service_healthy cli: build: ./services/cli command: bash -c 'npm install && node run.js dev' working_dir: $PWD/services/cli user: node volumes: - $PWD:$PWD - $HOME/.ssh:$HOME/.ssh # keeps esbuild watch running tty: true # exit node from SIGINT init: true