version: "3.9"
services:
app:
build:
dockerfile: Dockerfile-server
context: .
env_file:
- ./.env
depends_on:
- postgres
- migration
ports:
- "50051:50051"
entrypoint: /app/grpc-server/grpc-server
postgres:
image: postgres:14.2
healthcheck:
test: [ "CMD", "pg_isready", "-U", "$POSTGRES_USER", "-d", "$POSTGRES_DB" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
env_file:
- ./.env
deploy:
resources:
limits:
cpus: '1'
memory: 4G
ports:
- "5432:5432"
migration:
working_dir: /migrations
image: migrate/migrate
volumes:
- ./pkg/db/postgres/migrations:/migrations
command: [ "-path", "", "-database", "postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable", "up" ]
depends_on:
- postgres
Migrations fail when I'm trying to launch docker-compose. Error: URL cannot be empty What url I need to write if I specified my work-dir in migration service. Thanks in advance