mirror of
https://github.com/valitydev/api-key-mgmt-v2.git
synced 2024-11-06 02:15:19 +00:00
OPS-268: Change user (#17)
This commit is contained in:
parent
cc42e72073
commit
7196f37e86
@ -25,6 +25,8 @@ RUN rebar3 compile && \
|
|||||||
FROM docker.io/library/erlang:${OTP_VERSION}-slim
|
FROM docker.io/library/erlang:${OTP_VERSION}-slim
|
||||||
|
|
||||||
ARG SERVICE_NAME
|
ARG SERVICE_NAME
|
||||||
|
ARG USER_UID=1001
|
||||||
|
ARG USER_GID=$USER_UID
|
||||||
|
|
||||||
# Set env
|
# Set env
|
||||||
ENV CHARSET=UTF-8
|
ENV CHARSET=UTF-8
|
||||||
@ -44,6 +46,13 @@ ENV WORK_DIR=/opt/${SERVICE_NAME}
|
|||||||
RUN echo "#!/bin/sh" >> /entrypoint.sh && \
|
RUN echo "#!/bin/sh" >> /entrypoint.sh && \
|
||||||
echo "exec /opt/${SERVICE_NAME}/bin/${SERVICE_NAME} foreground" >> /entrypoint.sh && \
|
echo "exec /opt/${SERVICE_NAME}/bin/${SERVICE_NAME} foreground" >> /entrypoint.sh && \
|
||||||
chmod +x /entrypoint.sh
|
chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
RUN groupadd --gid ${USER_GID} ${SERVICE_NAME} && \
|
||||||
|
mkdir /var/log/${SERVICE_NAME} && \
|
||||||
|
chown ${USER_UID}:${USER_GID} /var/log/${SERVICE_NAME} && \
|
||||||
|
useradd --uid ${USER_UID} --gid ${USER_GID} -M ${SERVICE_NAME}
|
||||||
|
USER ${SERVICE_NAME}
|
||||||
|
|
||||||
ENTRYPOINT []
|
ENTRYPOINT []
|
||||||
CMD ["/entrypoint.sh"]
|
CMD ["/entrypoint.sh"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user