services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_DB: rentaldrivego POSTGRES_USER: postgres POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-me} healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d rentaldrivego"] interval: 5s timeout: 5s retries: 10 volumes: - postgres_prod_data:/var/lib/postgresql/data redis: image: redis:7-alpine restart: unless-stopped volumes: - redis_prod_data:/data migrate: build: context: . dockerfile: Dockerfile.production command: ["sh", "-c", "npm run db:deploy"] depends_on: postgres: condition: service_healthy env_file: - .env.docker.production restart: "no" api: build: context: . dockerfile: Dockerfile.production command: ["npm", "run", "start", "--workspace", "@rentaldrivego/api"] depends_on: postgres: condition: service_healthy redis: condition: service_started migrate: condition: service_completed_successfully env_file: - .env.docker.production ports: - "4000:4000" restart: unless-stopped marketplace: build: context: . dockerfile: Dockerfile.production command: ["npm", "run", "start", "--workspace", "@rentaldrivego/marketplace"] depends_on: - api env_file: - .env.docker.production ports: - "3000:3000" restart: unless-stopped dashboard: build: context: . dockerfile: Dockerfile.production command: ["npm", "run", "start", "--workspace", "@rentaldrivego/dashboard"] depends_on: - api env_file: - .env.docker.production ports: - "3001:3001" restart: unless-stopped admin: build: context: . dockerfile: Dockerfile.production command: ["npm", "run", "start", "--workspace", "@rentaldrivego/admin"] depends_on: - api env_file: - .env.docker.production ports: - "3002:3002" restart: unless-stopped public-site: build: context: . dockerfile: Dockerfile.production command: ["npm", "run", "start", "--workspace", "@rentaldrivego/public-site"] depends_on: - api env_file: - .env.docker.production ports: - "3003:3003" restart: unless-stopped volumes: postgres_prod_data: redis_prod_data: