mirror of
https://github.com/MOIS3Y/logs-collector.git
synced 2025-09-13 05:03:01 +02:00
Modify: settings - add DATA_DIR logs_collector storage_info use DATA_DIR as storage root
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -22,6 +22,7 @@ ENV PYTHONUNBUFFERED 1
|
||||
# default build args
|
||||
ARG VERSION=0.1.0 \
|
||||
APP_DIR=/app \
|
||||
DATA_DIR=/app/data \
|
||||
SRC_DIR=./logs_collector \
|
||||
SCRIPTS_DIR=./scripts \
|
||||
WEB_PORT=8000 \
|
||||
@@ -34,17 +35,20 @@ ARG VERSION=0.1.0 \
|
||||
COPY --from=base /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/
|
||||
COPY --from=base /usr/local/bin/ /usr/local/bin/
|
||||
|
||||
# add curl and createa user to avoid running container as root
|
||||
# add curl and createa user to avoid running container as root &&
|
||||
# create storage dir
|
||||
RUN apk add --no-cache --upgrade curl && \
|
||||
addgroup --system ${USER_GROUP} --gid ${APP_GID} && \
|
||||
adduser --system --uid ${APP_UID} --ingroup ${USER_GROUP} ${USER_NAME}
|
||||
adduser --system --uid ${APP_UID} --ingroup ${USER_GROUP} ${USER_NAME} && \
|
||||
mkdir -p ${APP_DIR}/data && \
|
||||
chown -R ${USER_NAME}:${USER_GROUP} ${DATA_DIR}
|
||||
|
||||
# switch to user
|
||||
USER ${USER_NAME}
|
||||
|
||||
# copy src and entrypoint.sh to app dir
|
||||
COPY --chown=${USER_NAME}:${USER_GROUP} ${SRC_DIR} ${APP_DIR}
|
||||
COPY --chown=${USER_NAME}:${USER_GROUP} ${SCRIPTS_DIR}/entrypoint.sh ${APP_DIR}/
|
||||
COPY --chown=${USER_NAME}:${USER_GROUP} ${SCRIPTS_DIR}/entrypoint.sh ${APP_DIR}
|
||||
|
||||
# set workdir
|
||||
WORKDIR ${APP_DIR}
|
||||
|
Reference in New Issue
Block a user