version: "3" services: postgres: image: postgres:14-alpine environment: - POSTGRES_DB=postgres - POSTGRES_USER=postgres - POSTGRES_PASSWORD=P@ssw0rd healthcheck: test: ["CMD", "pg_isready"] ports: - "5432:5432" networks: - coffeeshop-network rabbitmq: image: rabbitmq:3.11-management-alpine environment: RABBITMQ_DEFAULT_USER: guest RABBITMQ_DEFAULT_PASS: guest healthcheck: test: rabbitmq-diagnostics -q ping interval: 30s timeout: 30s retries: 3 ports: - "5672:5672" - "15672:15672" networks: - coffeeshop-network proxy: build: context: . dockerfile: ./docker/Dockerfile-proxy image: go-coffeeshop-proxy environment: APP_NAME: 'proxy-service in docker' GRPC_PRODUCT_HOST: 'product' GRPC_PRODUCT_PORT: 5001 GRPC_COUNTER_HOST: 'counter' GRPC_COUNTER_PORT: 5002 ports: - 5000:5000 depends_on: - product - counter networks: - coffeeshop-network product: build: context: . dockerfile: ./docker/Dockerfile-product image: go-coffeeshop-product environment: APP_NAME: 'product-service in docker' ports: - 5001:5001 networks: - coffeeshop-network counter: build: context: . dockerfile: ./docker/Dockerfile-counter image: go-coffeeshop-counter environment: APP_NAME: 'counter-service in docker' IN_DOCKER: "true" PG_URL: postgres://postgres:P@ssw0rd@postgres:5432/postgres RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/ PRODUCT_CLIENT_URL: product:5001 ports: - 5002:5002 depends_on: postgres: condition: service_healthy rabbitmq: condition: service_healthy networks: - coffeeshop-network barista: build: context: . dockerfile: ./docker/Dockerfile-barista image: go-coffeeshop-barista environment: APP_NAME: 'barista-service in docker' IN_DOCKER: "true" PG_URL: postgres://postgres:P@ssw0rd@postgres:5432/postgres RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/ depends_on: postgres: condition: service_healthy rabbitmq: condition: service_healthy networks: - coffeeshop-network kitchen: build: context: . dockerfile: ./docker/Dockerfile-kitchen image: go-coffeeshop-kitchen environment: APP_NAME: 'kitchen-service in docker' IN_DOCKER: "true" PG_URL: postgres://postgres:P@ssw0rd@postgres:5432/postgres RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/ depends_on: postgres: condition: service_healthy rabbitmq: condition: service_healthy networks: - coffeeshop-network web: build: context: . dockerfile: ./docker/Dockerfile-web image: go-coffeeshop-web environment: REVERSE_PROXY_URL: http://localhost:5000 WEB_PORT: 8888 ports: - 8080:8080 depends_on: - proxy networks: - coffeeshop-network networks: coffeeshop-network: