Last active
May 26, 2017 16:55
-
-
Save johannesE/7ee81d90d0934a70bd14350c562c9366 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
mix ecto.migrate | |
exec mix phoenix.server |
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: | |
# the database image | |
db: | |
image: "postgres:9.6" | |
ports: | |
- "5432:5432" | |
environment: | |
POSTGRES_USER: "gottserver" | |
POSTGRES_PASSWORD: "asdf" | |
POSTGRES_DB: "gottserver_prod" | |
volumes: | |
- data:/var/lib/postgresql/data | |
# the main image, this is the application | |
web: | |
build: "." | |
environment: | |
MIX_ENV: "prod" | |
PORT: "80" | |
DB_USER: "gottserver" | |
DB_PASSWORD: "asdf" | |
ports: | |
- "80:80" | |
links: | |
- "db:db" | |
# for persistence of database data | |
volumes: | |
data: | |
external: true | |
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 ubuntu:16.04 | |
RUN locale-gen en_US.UTF-8 | |
RUN locale-gen de_CH.UTF-8 | |
ENV LANG en_US.UTF-8 | |
ENV LANGUAGE en_US:en | |
ENV LC_ALL de_CH.UTF-8 | |
RUN apt-get update && apt-get install -y -q apt-transport-https wget build-essential # build -ssential includes make | |
# installing elixir | |
RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && dpkg -i erlang-solutions_1.0_all.deb | |
RUN apt-get update && apt-get install -y --no-install-recommends esl-erlang elixir | |
# gottserver specific | |
ADD . /app | |
WORKDIR /app | |
RUN mix local.hex --force | |
RUN mix local.rebar --force | |
RUN mix deps.get --only-prod | |
RUN MIX_ENV=prod mix compile | |
CMD ./docker_cmd.sh |
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
chmod +x docker_command.sh # one time deal | |
docker volume create --name=data # one time deal | |
docker-compose up -d --build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment