kopia lustrzana https://github.com/bellingcat/auto-archiver
Simplify entrypoint
rodzic
2c5b115fbe
commit
9cb73c073f
|
@ -26,10 +26,7 @@ COPY ./src/ .
|
||||||
# RUN useradd --system --groups sudo --shell /bin/bash archiver && chown -R archiver:sudo .
|
# RUN useradd --system --groups sudo --shell /bin/bash archiver && chown -R archiver:sudo .
|
||||||
# USER archiver
|
# USER archiver
|
||||||
|
|
||||||
ADD docker-entrypoint.sh /docker-entrypoint.sh
|
ENTRYPOINT ["pipenv", "run", "python3", "-m", "auto_archiver"]
|
||||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
||||||
|
|
||||||
CMD ["python3"]
|
|
||||||
|
|
||||||
# should be executed with 2 volumes (3 if local_storage)
|
# should be executed with 2 volumes (3 if local_storage)
|
||||||
# docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive aa --help
|
# docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive aa --help
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Get UID/GID from volume dir
|
|
||||||
|
|
||||||
VOLUME_UID=$(stat -c '%u' /crawls)
|
|
||||||
VOLUME_GID=$(stat -c '%g' /crawls)
|
|
||||||
|
|
||||||
# Get the UID/GID we are running as
|
|
||||||
|
|
||||||
MY_UID=$(id -u)
|
|
||||||
MY_GID=$(id -g)
|
|
||||||
|
|
||||||
# If we aren't running as the owner of the /crawls/ dir then add a new user
|
|
||||||
# btrix with the same UID/GID of the /crawls dir and run as that user instead.
|
|
||||||
|
|
||||||
if [ "$MY_GID" != "$VOLUME_GID" ] || [ "$MY_UID" != "$VOLUME_UID" ]; then
|
|
||||||
groupadd btrix
|
|
||||||
groupmod -o --gid $VOLUME_GID btrix
|
|
||||||
|
|
||||||
useradd -ms /bin/bash -g $VOLUME_GID btrix
|
|
||||||
usermod -o -u $VOLUME_UID btrix > /dev/null
|
|
||||||
|
|
||||||
su btrix -c '"$@"' -- argv0-ignore "$@"
|
|
||||||
else
|
|
||||||
exec "$@"
|
|
||||||
fi
|
|
||||||
|
|
Ładowanie…
Reference in New Issue