version: "3"
services:
web:
image: erlang:22.3
ports:
- "8080:8080"
- "8006:8006"
volumes:
- "./:/opt/erlang/app"
stdin_open: true
tty: true
mysql_db:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: "app"
MYSQL_DATABASE: "app"
MYSQL_USER: "app"
MYSQL_PASSWORD: "app"
volumes:
- "../app_db_db_scripts/latest.sql:/docker-entrypoint-initdb.d/app.sql"
ports:
- "3309:3306"
rabbit:
image: rabbitmq:latest
hostname: rabbit
environment:
RABBITMQ_ERLANG_COOKIE: "app"
node:
image: node:latest
ports:
- "8000:8000"
- "3001:3001"
- "3000:3000"
volumes:
- "../../../app/:/opt/erlang/app"
- "/tmp/.X11-unix:/tmp/.X11-unix"
stdin_open: true
tty: true
editor:
image: swaggerapi/swagger-editor:latest
ports:
- "8001:8080"
stdin_open: true
tty: true
above is a compose file i used for an erlang web application
so the compose file had sections for
erlang -for the web application(one port for application and one for edoc html files)
mysql -for the database
rabbitmq - for rabbitmq server
node - was using zurb framework for frontend so needed a nodejs image
swagger -for the api editor
below is also a simpler one for elixir which i have used before
version: "3"
services:
web:
image: elixir:1.7.4
ports:
- "4000:4000"
volumes:
- "./:/opt/elixir/elixir"
stdin_open: true
tty: true
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: example
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- "5433:5432"