Skip to content

Commit

Permalink
build: use Alpine in Docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
boringcactus committed Nov 9, 2023
1 parent fe9fd14 commit e77365d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# --- Set up Elixir build ---
FROM hexpm/elixir:1.15.7-erlang-26.1.2-debian-bullseye-20231009-slim as elixir-builder
FROM hexpm/elixir:1.15.7-erlang-26.1.2-alpine-3.18.4 as elixir-builder

ENV LANG=C.UTF-8 MIX_ENV=prod

RUN apt-get update --allow-releaseinfo-change
RUN apt-get install --no-install-recommends --yes \
build-essential ca-certificates git
RUN apk add --no-cache \
git
RUN mix local.hex --force
RUN mix local.rebar --force

Expand Down Expand Up @@ -33,13 +32,12 @@ RUN mix release


# --- Set up runtime container ---
FROM debian:bullseye-slim
FROM alpine:3.18.4

ENV LANG=C.UTF-8 MIX_ENV=prod REPLACE_OS_VARS=true

RUN apt-get update --allow-releaseinfo-change \
&& apt-get install --no-install-recommends --yes dumb-init wget \
&& rm -rf /var/lib/apt/lists/*
RUN apk add --no-cache \
dumb-init libgcc libstdc++ ncurses-libs

# Create non-root user
RUN addgroup --system mobileappbackend && adduser --system --ingroup mobileappbackend mobileappbackend
Expand Down

0 comments on commit e77365d

Please sign in to comment.