# Adding Solid Docker Compose Recipes

**URL:** <https://forum.elixirforum.com/t/adding-solid-docker-compose-recipes/30417>\
**Category:** Discussions\
**Tags:** ecto, phoenix, deployment, learning-elixir\
**Created:** [April 6, 2020, 8:30pm UTC](https://forum.elixirforum.com/t/adding-solid-docker-compose-recipes/30417 "2020-04-06T20:30:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nayibor](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nayibor/32/16153_2.png) [@nayibor](https://forum.elixirforum.com/u/nayibor)\
**Post date:** [April 8, 2020, 8:25am UTC](https://forum.elixirforum.com/t/adding-solid-docker-compose-recipes/30417/3 "2020-04-08T08:25:51Z")

</div>

```elixir
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

```elixir
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"

```

---

_[View the full topic](https://forum.elixirforum.com/t/adding-solid-docker-compose-recipes/30417)._
