Created
November 3, 2017 10:47
-
-
Save Kukunin/5ba77a99125eb257e7326408d4de252b to your computer and use it in GitHub Desktop.
Dockerfile along with docker-compose.yml for a typical phoenix 1.3 elixir application
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: | |
db-data: | |
image: postgres | |
command: /bin/true | |
db: | |
image: postgres | |
volumes_from: | |
- db-data | |
environment: | |
POSTGRES_USER: elichat | |
POSTGRES_PASSWORD: "your_password" | |
web-data: | |
image: busybox | |
volumes: | |
- /app/priv/static/uploads | |
web: | |
build: . | |
volumes_from: | |
- web-data | |
volumes: | |
- ./prod.secret.exs:/app/config/prod.exs:ro | |
ports: | |
- "4000:4000" | |
depends_on: | |
- db | |
restart: always |
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 | |
MAINTAINER Sergiy Kukunin <[email protected]> | |
RUN wget -qO- https://deb.nodesource.com/setup_8.x | bash - && \ | |
apt-get install -y nodejs | |
RUN mix local.rebar | |
RUN mix local.hex --force | |
WORKDIR /app | |
ENV MIX_ENV prod | |
ADD mix.exs /app/mix.exs | |
ADD mix.lock /app/mix.lock | |
RUN mix do deps.get, deps.compile | |
ADD assets/package.json /app/assets/package.json | |
ADD assets/package-lock.json /app/assets/package-lock.json | |
RUN cd assets && npm install | |
ADD . /app | |
RUN cd assets && npm run deploy | |
CMD mix do phx.digest, phx.server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment