Skip to content

Commit

Permalink
fix: re-state arg from env in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedsoupe committed Sep 9, 2024
1 parent a74bbf1 commit e7138a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ WORKDIR /app
RUN apk update --no-cache
RUN apk add --no-cache build-base gcc curl git wget nodejs npm

ARG MIX_ENV=prod
ENV MIX_ENV=$MIX_ENV

# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
Expand All @@ -26,7 +29,7 @@ RUN mkdir config
# copy compile-time config files before we compile dependencies
# to ensure any relevant config change will trigger the dependencies
# to be re-compiled.
COPY config/config.exs config/${MIX_ENV}.exs config/
COPY config/config.exs config/$MIX_ENV.exs config/
RUN mix deps.compile

COPY priv priv
Expand Down Expand Up @@ -58,6 +61,9 @@ RUN apk update --no-cache
RUN apk add --no-cache tzdata openssl ncurses wget
RUN apk add --no-cache chromium --repository=http://dl-cdn.alpinelinux.org/alpine/v3.18/community

ARG MIX_ENV=prod
ENV MIX_ENV=$MIX_ENV

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
Expand All @@ -69,7 +75,7 @@ RUN chown nobody /app
ENV MIX_ENV="prod"

# Only copy the final release from the build stage
COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/pescarte ./
COPY --from=builder --chown=nobody:root /app/_build/$MIX_ENV/rel/pescarte ./

USER nobody

Expand Down

0 comments on commit e7138a2

Please sign in to comment.