mirror of
https://gitlab.com/psono/psono-fileserver
synced 2025-04-18 12:24:05 +03:00
41 lines
1.7 KiB
Plaintext
41 lines
1.7 KiB
Plaintext
# PSONO Dockerfile for Alpine
|
|
FROM psono-docker.jfrog.io/python:3.11.10-alpine3.20
|
|
|
|
LABEL maintainer="Sascha Pfeiffer <sascha.pfeiffer@psono.com>"
|
|
COPY . /root/
|
|
ENV PYTHONUNBUFFERED True
|
|
WORKDIR /root
|
|
|
|
RUN apk upgrade --no-cache && \
|
|
mkdir -p /root/.pip && \
|
|
echo '[global]' >> /root/.pip/pip.conf && \
|
|
echo 'index-url = https://psono.jfrog.io/psono/api/pypi/pypi/simple' >> /root/.pip/pip.conf && \
|
|
apk add --no-cache \
|
|
ca-certificates \
|
|
dcron \
|
|
curl \
|
|
build-base \
|
|
libffi-dev \
|
|
openssl-dev \
|
|
linux-headers && \
|
|
pip3 install --upgrade pip && \
|
|
pip3 install -r requirements.txt && \
|
|
mkdir -p /root/.psono_fileserver /var/log/cron /opt/psono-shard && \
|
|
echo "*/5 * * * * ( touch /tmp/psono_fileserver_cleanup && curl --header \"Authorization: Token \$(cat /root/PSONOFS_CRON_ACCESS_KEY)\" -f http://localhost/cron/cleanup/chunks/ && touch /tmp/psono_fileserver_cleanup_success )" >> /etc/crontabs/root && \
|
|
echo "@reboot ( touch /tmp/psono_fileserver_ping && python3 /root/psono/cron.py --token \"\$(cat /root/PSONOFS_CRON_ACCESS_KEY)\" --url http://localhost && touch /tmp/psono_fileserver_ping_success )" >> /etc/crontabs/root && \
|
|
cp /root/configs/mainconfig/settings.yaml /root/.psono_fileserver/settings.yaml && \
|
|
sed -i s,path/to/psono-fileserver,root,g /root/.psono_fileserver/settings.yaml && \
|
|
apk del --no-cache \
|
|
build-base \
|
|
libffi-dev \
|
|
linux-headers && \
|
|
rm -Rf \
|
|
/root/.cache
|
|
|
|
|
|
HEALTHCHECK --interval=2m --timeout=3s \
|
|
CMD curl -f http://localhost/healthcheck/ || exit 1
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["/bin/sh", "/root/configs/docker/cmd.sh"] |