Skip to content

Instantly share code, notes, and snippets.

@UsamaAshraf
Last active April 27, 2018 10:00
Show Gist options
  • Save UsamaAshraf/009e92d69ed0ef6dba66e534ca3d7bdc to your computer and use it in GitHub Desktop.
Save UsamaAshraf/009e92d69ed0ef6dba66e534ca3d7bdc to your computer and use it in GitHub Desktop.
Docker Compose file for Python & Go services communicating via RabbitMQ
# docker-compose.yml
version: "3.2"
services:
rabbitmq-server:
build: ./rabbitmq-server
python-service:
build: ./python-service
# 'rabbitmq-server' will be available as a network reference inside this service
# and this service will start only after the RabbitMQ service does.
depends_on:
- rabbitmq-server
# Keep it running.
tty: true
# Map port 3000 on the host machine to port 3000 of the container.
# This will be used to receive HTTP requests made to the service.
ports:
- "3000:3000"
volumes:
- './python-service:/python-service'
go-service:
build: ./go-service
depends_on:
- rabbitmq-server
tty: true
volumes:
- './go-service:/go-service'
# Host volumes used to store code.
volumes:
python-service:
go-service:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment