working on redundancy
This commit is contained in:
38
Dockerfile
Normal file
38
Dockerfile
Normal file
@@ -0,0 +1,38 @@
|
||||
# ---- Build stage ----
|
||||
FROM elixir:1.19.5-otp-28-alpine AS build
|
||||
|
||||
RUN apk add --no-cache build-base git nodejs npm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV MIX_ENV=prod
|
||||
|
||||
RUN mix local.hex --force && mix local.rebar --force
|
||||
|
||||
COPY mix.exs mix.lock ./
|
||||
RUN mix deps.get --only prod
|
||||
RUN mix deps.compile
|
||||
|
||||
COPY config config
|
||||
COPY priv priv
|
||||
COPY lib lib
|
||||
COPY assets assets
|
||||
|
||||
RUN mix assets.deploy
|
||||
RUN mix release
|
||||
|
||||
# ---- Runtime stage ----
|
||||
FROM elixir:1.19.5-otp-28-alpine AS runtime
|
||||
|
||||
RUN apk add --no-cache libstdc++ openssl ncurses-libs
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/_build/prod/rel/elixir_ai ./
|
||||
RUN touch .env
|
||||
|
||||
ENV PHX_SERVER=true
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
CMD ["bin/elixir_ai", "start"]
|
||||
Reference in New Issue
Block a user