mirror of
https://github.com/valitydev/party-management.git
synced 2024-11-06 01:05:21 +00:00
OPS-268: Setups user in Dockerfile
(#36)
This commit is contained in:
parent
14c307f0de
commit
defe3f23ac
@ -23,6 +23,8 @@ RUN rebar3 compile && \
|
||||
FROM docker.io/library/erlang:${OTP_VERSION}-slim
|
||||
|
||||
ARG SERVICE_NAME
|
||||
ARG USER_UID=1001
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Set env
|
||||
ENV CHARSET=UTF-8
|
||||
@ -36,6 +38,12 @@ COPY --from=builder /build/_build/prod/rel/${SERVICE_NAME} /opt/${SERVICE_NAME}
|
||||
RUN echo "#!/bin/sh" >> /entrypoint.sh && \
|
||||
echo "exec /opt/${SERVICE_NAME}/bin/${SERVICE_NAME} foreground" >> /entrypoint.sh && \
|
||||
chmod +x /entrypoint.sh
|
||||
|
||||
# Setup user
|
||||
RUN groupadd --gid ${USER_GID} ${SERVICE_NAME} && \
|
||||
useradd --uid ${USER_UID} --gid ${USER_GID} -M ${SERVICE_NAME}
|
||||
USER ${SERVICE_NAME}
|
||||
|
||||
ENTRYPOINT []
|
||||
CMD ["/entrypoint.sh"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user