-
Notifications
You must be signed in to change notification settings - Fork 1
Revised app so that it can be ran in docker. #3
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| $xport POSTGRES_USER='swm' | ||
| export POSTGRES_PASSWORD='' | ||
| export POSTGRES_DB='website_dev' | ||
| export POSTGRES_HOST='localhost' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In fact, was this file intended to be committed? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| FROM elixir:1.9.4-alpine | ||
|
|
||
| MAINTAINER Stephen McCullough <stephen.mccullough@gmail.com> | ||
|
|
||
| RUN apk add postgresql-client | ||
| RUN apk add nodejs | ||
| RUN apk add --update npm | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we install |
||
|
|
||
|
|
||
| ADD . /app | ||
| WORKDIR /app | ||
|
|
||
| RUN mkdir -p /app/assets | ||
| WORKDIR /app | ||
|
|
||
| ENV NODE_ENV=development | ||
|
|
||
| COPY assets/package.json assets/package-lock.json ./assets/ | ||
| COPY deps/phoenix deps/phoenix | ||
| COPY deps/phoenix_html deps/phoenix_html | ||
|
|
||
| RUN mix local.hex --force | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should come before line 10 (which copies the code onto the image). This way, a code change doesn't bust the image cache. |
||
|
|
||
| RUN cd assets && npm install | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly here. Moving |
||
|
|
||
| # build assets | ||
| COPY assets ./assets/ | ||
|
|
||
| EXPOSE 4000 | ||
| CMD ["./run.sh"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,13 +14,20 @@ The website will then injest this API. | |
|
|
||
| ## Developing | ||
|
|
||
| To start the app: | ||
| ### Natively | ||
|
|
||
|
|
||
| * export your env vars via `local.env.template` (this isn't loaded so amend, copy, paste and execute). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could instruct users to do |
||
| * `mix deps.get` | ||
| * `mix ecto.setup` | ||
| * `cd assets && npm install` | ||
| * `mix phx.server` | ||
|
|
||
| ### Docker | ||
|
|
||
| * `docker-compose build` | ||
| * `docker-compose up` | ||
|
|
||
| Visit [`localhost:4000`](http://localhost:4000). | ||
|
|
||
| ## Premise | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo?
$xport