Last active
January 26, 2018 12:49
-
-
Save tiagopog/9e6b0610eb8096064715ccc3b10b4004 to your computer and use it in GitHub Desktop.
Elixir/Phoenix - Dockerfiles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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