Hard fix docker permission (#16)

This commit is contained in:
matteo bocci aka matteob99 2020-11-25 15:39:54 +01:00 committed by GitHub
parent 19c38c61b3
commit ec95b6a5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -26,8 +26,8 @@ RUN addgroup -g 101 -S telegram-bot-api \
&& adduser -S -D -H -u 101 -h ${TELEGRAM_WORK_DIR} -s /sbin/nologin -G telegram-bot-api -g telegram-bot-api telegram-bot-api \
&& chmod +x /docker-entrypoint.sh \
&& mkdir -p ${TELEGRAM_WORK_DIR} ${TELEGRAM_TEMP_DIR} \
&& chown telegram-bot-api:telegram-bot-api ${TELEGRAM_WORK_DIR} \
&& chown nobody:nobody ${TELEGRAM_TEMP_DIR}
&& chown telegram-bot-api:telegram-bot-api ${TELEGRAM_WORK_DIR} ${TELEGRAM_TEMP_DIR}\
&& chmod 666 ${TELEGRAM_TEMP_DIR}
USER telegram-bot-api:telegram-bot-api
HEALTHCHECK CMD curl -f http://localhost:8082/ || exit 1

View File

@ -5,7 +5,9 @@ set -e
USERNAME=telegram-bot-api
GROUPNAME=telegram-bot-api
chown ${USERNAME}:${GROUPNAME} "${TELEGRAM_WORK_DIR}"
chown ${USERNAME}:${GROUPNAME} "${TELEGRAM_WORK_DIR}" "${TELEGRAM_TEMP_DIR}"
chmod 666 "${TELEGRAM_TEMP_DIR}"
if [ -n "${1}" ]; then
exec "${*}"