Skip to content

Instantly share code, notes, and snippets.

@tiagopog
Last active January 26, 2018 12:49
Show Gist options
  • Save tiagopog/9e6b0610eb8096064715ccc3b10b4004 to your computer and use it in GitHub Desktop.
Save tiagopog/9e6b0610eb8096064715ccc3b10b4004 to your computer and use it in GitHub Desktop.
Elixir/Phoenix - Dockerfiles
version: "2"
services:
web:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
environment:
- PG_HOST=postgres
- PG_PORT=5432
stdin_open: true
tty: true
links:
- postgres
ports:
- "4000:4000"
expose:
- "4000"
postgres:
image: postgres:9.6.3
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- "5432:5432"
expose:
- "5432"
FROM elixir:1.5.2
ENV PHOENIX_VERSION=1.3.0 \
APP_PATH=/app
RUN mkdir -p $APP_PATH
WORKDIR $APP_PATH
RUN mix local.hex
RUN yes | mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new-$PHOENIX_VERSION.ez
COPY . $APP_PATH
RUN yes | mix do deps.get, deps.compile
# https://hexdocs.pm/phoenix/installation.html#inotify-tools-for-linux-users
RUN apt-get update && apt-get install -y inotify-tools
CMD ["mix", "phoenix.server"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment