Skip to content

Commit

Permalink
run management container as non-root (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Aug 14, 2024
1 parent 303ee4c commit 1535200
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions wis2-gdc-management/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ENV TZ="Etc/UTC" \
COPY ./ /app

# add to crontab
COPY ./docker/wis2-gdc-management.cron /etc/cron.d/wis2-gdc-management.cron
COPY ./docker/wis2-gdc-management.cron /var/spool/cron/crontabs/wis2-gdc

RUN apt-get update -y && \
# install dependencies
Expand All @@ -45,7 +45,11 @@ RUN apt-get update -y && \
apt autoremove -y && \
apt-get -q clean && \
rm -rf /var/lib/apt/lists/* && \
chmod 0644 /etc/cron.d/wis2-gdc-management.cron && \
crontab /etc/cron.d/wis2-gdc-management.cron
chmod 0644 /var/spool/cron/crontabs/wis2-gdc && \
crontab /var/spool/cron/crontabs/wis2-gdc && \
# add wis2-gdc user
useradd -ms /bin/bash wis2-gdc

USER wis2-gdc

ENTRYPOINT [ "/app/docker/entrypoint.sh" ]
2 changes: 1 addition & 1 deletion wis2-gdc-management/docker/wis2-gdc-management.cron
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0 0 * * * su -c "wis2-gdc archive $WIS2_GDC_METADATA_ARCHIVE_ZIPFILE" > /proc/1/fd/1 2>/proc/1/fd/2
0 0 * * * wis2-gdc archive $WIS2_GDC_METADATA_ARCHIVE_ZIPFILE > /proc/1/fd/1 2>/proc/1/fd/2

0 comments on commit 1535200

Please sign in to comment.