Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Docker #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM elixir:1.9

RUN mix local.hex --force && mix local.rebar --force

WORKDIR /app

COPY mix.exs mix.lock ./
RUN mix do deps.get, deps.compile

COPY . ./
RUN mix compile

CMD ./start.sh
4 changes: 2 additions & 2 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ config :eventstore, EventStore.Storage,
username: "postgres",
password: "postgres",
database: "conduit_eventstore_dev",
hostname: "localhost",
hostname: "eventstore",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By doing this, you will force everybody to run on docker. Because if you run it locally it won't work..

I'm pretty sure this is not what people want :) What do you think?

pool_size: 10

# Configure the read store database
Expand All @@ -51,5 +51,5 @@ config :conduit, Conduit.Repo,
username: "postgres",
password: "postgres",
database: "conduit_readstore_dev",
hostname: "localhost",
hostname: "readstore",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same than ☝️

pool_size: 10
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3'

services:
app:
build: .
depends_on:
- eventstore
- readstore
ports:
- 4000:4000

eventstore:
image: postgres

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should prefix and use a fix major version.


readstore:
image: postgres

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same ☝️

5 changes: 5 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

mix do event_store.create, event_store.init
mix do ecto.create, ecto.migrate
mix phx.server