services: # PostgreSQL Database postgres: image: docker.io/postgres:15-alpine restart: unless-stopped environment: POSTGRES_DB: medusa-store POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres ports: - "5432:5432" volumes: - ${GLOBAL_DATA_FOLDER:-/Data}/${SERVICE_NAME_OVERRIDE:-my-medusa-store}/postgres_data:/var/lib/postgresql/data networks: - default healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d medusa-store"] interval: 10s timeout: 5s retries: 5 start_period: 10s # Redis redis: image: docker.io/redis:7-alpine restart: unless-stopped ports: - "6379:6379" networks: - default healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 start_period: 10s medusa: build: context: . dockerfile: Dockerfile.dev args: UID: ${UID:-1000} GID: ${GID:-1000} user: "${UID:-1000}:${GID:-1000}" restart: unless-stopped depends_on: postgres: condition: service_healthy redis: condition: service_healthy ports: - "9000:9000" environment: - NODE_ENV=development - DATABASE_URL=postgres://postgres:postgres@postgres:5432/medusa-store - REDIS_URL=redis://redis:6379 env_file: - .env healthcheck: test: ["CMD", "wget", "-q", "--spider", "http://localhost:9000/health"] interval: 30s timeout: 10s start_period: 120s retries: 3 develop: watch: - action: sync path: ./packages target: /server/packages - action: sync path: ./medusa-config.js target: /server/medusa-config.js - action: sync path: ./start.sh target: /server/start.sh - action: rebuild path: package.json - action: rebuild path: yarn.lock networks: - default volumes: postgres_data: networks: default: driver: bridge