Skip to content

Commit

Permalink
fix: Don't overwrite dep directories in docker-compose'ed containers (
Browse files Browse the repository at this point in the history
#2182)

Co-authored-by: Cristen Jones <[email protected]>
  • Loading branch information
joshlarson and thecristen authored Oct 3, 2024
1 parent 02f0f4a commit 3308926
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ For details on environment configuration, including optional variables, see
The easiest way to develop MBTA dotcom is to use Docker Compose.
```
docker compose -f deploy/dev.yml up -d
docker compose -f deploy/dev.yml up -d --build
```
This will set up Redis in cluster mode and run two versions of Dotcom with nginx load balancing requests between them.
Expand Down
6 changes: 6 additions & 0 deletions deploy/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ services:
timeout: 10s
volumes:
- ../:/app
- /app/_build
- /app/deps
- /app/assets/node_modules
networks:
dotcom_network:
ipv4_address: 10.0.0.2
Expand Down Expand Up @@ -83,6 +86,9 @@ services:
timeout: 10s
volumes:
- ../:/app
- /app/_build
- /app/deps
- /app/assets/node_modules
networks:
dotcom_network:
ipv4_address: 10.0.0.3
Expand Down
5 changes: 4 additions & 1 deletion deploy/dotcom/dev/1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ COPY mix.exs .
COPY mix.lock .
COPY package.json .
COPY assets/package.json ./assets/package.json
COPY assets/package-lock.json ./assets/package-lock.json

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

RUN mix deps.get
RUN npm --prefix assets install --package-lock-only --ignore-scripts --no-save --audit false --fund false --loglevel verbose
RUN mix deps.compile
RUN npm install --prefix assets --omit=optional --audit false --fund false --loglevel verbose --ignore-scripts

CMD elixir --sname dotcom1 --cookie foobarbaz -S mix phx.server
10 changes: 10 additions & 0 deletions deploy/dotcom/dev/2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@ WORKDIR /app

COPY mix.exs .
COPY mix.lock .
COPY package.json .
COPY assets/package.json ./assets/package.json
COPY assets/package-lock.json ./assets/package-lock.json

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

RUN mix deps.get
RUN mix deps.compile
RUN npm install --prefix assets --omit=optional --audit false --fund false --loglevel verbose --ignore-scripts

CMD elixir --sname dotcom2 --cookie foobarbaz -S mix phx.server

0 comments on commit 3308926

Please sign in to comment.