I’m trying to deploy on Alpine
Build looks fine, but I couldn’t spin up the server. Deployment says success but server doesn’t respond.
I’ve got bin/server
and bin/migrate
from flyctl launch
, maybe this is problem?
# bin/server
#!/bin/sh
cd -P -- "$(dirname -- "$0")"
PHX_SERVER=true exec ./feder start
Is this supposed to work in Alpine?
Below is the Dockerfile
FROM elixir:alpine AS builder
ENV MIX_ENV="prod"
RUN apk add --no-cache build-base git
WORKDIR /app
RUN mix local.hex --force && \
mix local.rebar --force
COPY mix.exs mix.lock ./
RUN mix deps.get --only $MIX_ENV
RUN mkdir config
COPY config/config.exs config/$MIX_ENV.exs config/
RUN mix deps.compile
COPY priv priv
COPY assets assets
RUN mix assets.deploy
COPY lib lib
RUN mix compile
COPY config/runtime.exs config/
COPY rel rel
RUN mix release
FROM alpine:3.16 AS runner
ENV MIX_ENV="prod"
ENV ECTO_IPV6 true
ENV ERL_AFLAGS "-proto_dist inet6_tcp"
RUN apk add --no-cache libstdc++ ncurses-libs openssl
WORKDIR /app
COPY --from=builder /app/_build/${MIX_ENV}/rel/feder ./
ENTRYPOINT [ "bin/server" ]