# 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:** 13

<div class="post-metadata">

**Author:** ![JackMaarek](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jackmaarek/32/18793_2.png) [@JackMaarek](https://forum.elixirforum.com/u/JackMaarek)\
**Post date:** [May 12, 2020, 1:34pm UTC](https://forum.elixirforum.com/t/adding-solid-docker-compose-recipes/30417/13 "2020-05-12T13:34:33Z")

</div>

With pleasure !

Here is the new project directory:

 ![Screenshot 2020-05-12 at 15.31.10](https://forum.elixirforum.com/uploads/default/original/3X/e/2/e28d4385aa44ea56b6c91bb798359117bdde2b3f.png)

The Dockerfile :

```elixir
FROM elixir:latest

RUN mix local.hex --force &&\
    mix local.rebar --force &&\
    #This part could be removed as we do not need to install phoenix dependencies.
    mix archive.install hex phx_new 1.4.16 --force

RUN apt-get update && \
  ## install inotify-tool for phoenix hot reload
  apt-get install -y inotify-tools && \
  # install nodejs and npm on globaly
  curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
   apt-get install -y -q nodejs && \
  # Install postgres client
  apt-get install -y postgresql-client && \
  # Clear apt cache
   rm -rf /var/lib/apt/lists/*

WORKDIR /phoenix

COPY . /phoenix

EXPOSE 4000

```

The docker-compose file:

```elixir
version: '3.7'

services:
  db:
    image: postgres:9.6
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      PGDATA: /var/lib/postgresql/data/pgdata
    restart: always
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"
  phoenix:
    build: .
    volumes:
      - .docker/phoenix/phoenix-setup.sh:/phoenix-setup.sh
    command: ../phoenix-setup.sh
    environment:
      PGUSER: postgres
      PGPASSWORD: postgres
      PGDATABASE: portfolio
      PGPORT: 5432
      PGHOST: db
    ports:
      - "4000:4000"
    depends_on:
      - db
volumes:
  pgdata:

```

And .dockerignore:

```elixir
deps
_build
assets/node_modules
test

```

If you have any suggestion/reviews I will love to hear them.

Thanks a lot !

---

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