pipeline
Some checks failed
Build and Deploy / Build & Push Image (push) Has been cancelled

This commit is contained in:
2026-03-16 13:08:33 -06:00
parent 43dc14745f
commit eed8e0f659
5 changed files with 187 additions and 9 deletions

View File

@@ -1,27 +1,52 @@
FROM hexpm/elixir:1.18.4-erlang-26.2.5.18-debian-bookworm-20260223-slim
# ---- Build stage ----
FROM hexpm/elixir:1.18.4-erlang-26.2.5.18-debian-bookworm-20260223-slim AS builder
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
inotify-tools \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN mix local.hex --force && \
mix local.rebar --force
RUN mix local.hex --force && mix local.rebar --force
ENV MIX_ENV=prod
COPY mix.exs mix.lock ./
RUN mix deps.get
RUN mix deps.get --only prod
RUN mix deps.compile
COPY config config
COPY assets assets
COPY lib lib
COPY priv priv
COPY lib lib
RUN mix assets.setup
RUN mix assets.setup && mix assets.deploy
RUN mix compile && mix release
# ---- Runtime stage ----
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
libstdc++6 \
openssl \
libncurses5 \
locales \
ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG=en_US.UTF-8
WORKDIR /app
RUN chown nobody /app
COPY --from=builder --chown=nobody:root /app/_build/prod/rel/cobblemon_ui ./
USER nobody
ENV PHX_SERVER=true
EXPOSE 4000
CMD ["mix", "phx.server"]
CMD ["/app/bin/cobblemon_ui", "start"]