Skip to content

Commit

Permalink
fix dockerfile for refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperVaessen committed Dec 5, 2024
1 parent 3ae925f commit cb0f46f
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,21 @@
# This file is based on these images:
#
# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20241016-slim - for the release image
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20241202-slim - for the release image
# - https://pkgs.org/ - resource for finding needed packages
# - Ex: hexpm/elixir:1.17.3-erlang-27.1.2-debian-bullseye-20241016-slim
# - Ex: hexpm/elixir:1.17.3-erlang-27.1.2-debian-bullseye-20241202-slim
#
ARG ELIXIR_VERSION=1.17.3
ARG OTP_VERSION=27.1.2
ARG DEBIAN_VERSION=bullseye-20241016-slim
ARG NODEJS_VERSION=20.18.0
ARG DEBIAN_VERSION=bullseye-20241202-slim

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"

FROM ${BUILDER_IMAGE} as builder

# install build dependencies
RUN apt-get update -y \
&& apt-get install -y build-essential git \
&& curl -fsSL https://deb.nodesource.com/setup_$NODEJS_VERSION.x | bash - \
&& apt-get install nodejs npm -y \
RUN apt-get update -y && apt-get install -y build-essential git \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*

# prepare build dir
Expand Down Expand Up @@ -53,10 +49,9 @@ COPY priv priv

COPY lib lib

# compile assets
COPY assets assets

RUN npm i --prefix assets
# compile assets
RUN mix assets.deploy

# Compile the release
Expand All @@ -66,7 +61,6 @@ RUN mix compile
COPY config/runtime.exs config/

COPY rel rel

RUN mix release

# start a new build stage so that the final image will only contain
Expand Down Expand Up @@ -100,6 +94,4 @@ USER nobody
# above and adding an entrypoint. See https://github.com/krallin/tini for details
# ENTRYPOINT ["/tini", "--"]

RUN chmod +x /app/bin/*
EXPOSE 8080:8080
CMD ["/app/bin/server"]
CMD ["/app/bin/server"]

0 comments on commit cb0f46f

Please sign in to comment.