api specs
This commit is contained in:
44
Dockerfile.phoenix
Normal file
44
Dockerfile.phoenix
Normal file
@@ -0,0 +1,44 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM --platform=$BUILDPLATFORM node:20-alpine AS frontend-builder
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package.json frontend/pnpm-lock.yaml ./
|
||||
RUN corepack enable && pnpm install --frozen-lockfile
|
||||
COPY frontend/ ./
|
||||
RUN pnpm build
|
||||
|
||||
FROM --platform=$BUILDPLATFORM elixir:1.18.4-otp-28 AS phoenix-builder
|
||||
ENV MIX_ENV=prod
|
||||
WORKDIR /app/phoenix
|
||||
|
||||
RUN mix local.hex --force && mix local.rebar --force
|
||||
|
||||
COPY phoenix/mix.exs phoenix/mix.lock ./
|
||||
RUN mix deps.get --only prod
|
||||
RUN mix deps.compile
|
||||
|
||||
COPY phoenix/config ./config
|
||||
COPY phoenix/lib ./lib
|
||||
COPY phoenix/priv ./priv
|
||||
RUN mix compile
|
||||
RUN mix release
|
||||
|
||||
FROM --platform=$TARGETPLATFORM elixir:1.18.4-otp-28
|
||||
RUN groupadd -r app && useradd -r -g app app
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=phoenix-builder /app/phoenix/_build/prod/rel/shooting_event_phx /app
|
||||
COPY --from=frontend-builder /app/frontend/dist /app/web
|
||||
|
||||
RUN mkdir -p /app/data && chown -R app:app /app
|
||||
USER app
|
||||
|
||||
ENV PHX_SERVER=true
|
||||
ENV PORT=8080
|
||||
ENV DB_PATH=/app/data/shooting.db
|
||||
ENV WEB_DIR=/app/web
|
||||
ENV SECRET_KEY_BASE=pxh_v1_V2Y3TXF4Rk9OUm5FdlVQc2s3M2hqd0t1Q2pwYUx4N3Vjb2I5Wk1qXzJ5RWRmQnJ
|
||||
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/app/bin/shooting_event_phx"]
|
||||
CMD ["start"]
|
||||
Reference in New Issue
Block a user