Sure, but I wonder if the cookie path can be somehow changed in vm.args.
FROM alpine:latest
RUN mkdir -p /app && chown -R nobody: /app
# By doing this the app doesn't boot, it complains about the owner of the file
# RUN touch /.erlang.cookie && chmod 600 /.erlang.cookie
WORKDIR /app
USER nobody
COPY --chown=nobody:nobody _build/prod/rel/my_app .
ENV REPLACE_OS_VARS=true
ENV HTTP_PORT=4291 BEAM_PORT=14291 ERL_EPMD_PORT=24291
EXPOSE $HTTP_PORT $BEAM_PORT $ERL_EPMD_PORT
ENTRYPOINT ["/app/bin/my_app"]