mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 09:22:38 +02:00

* /healthcheck endpoint usefull for monitoring, ci test also uses this * customizable PORT with environment variable * customizable PUID/PGID, reduce attack surface and allow better integration in rootless environments * size optimization * update to python 3.10 * add postgresql compatibility * PUID/PGID default as root to not break current user environments
57 lines
1.6 KiB
Docker
57 lines
1.6 KiB
Docker
FROM python:3.10-alpine
|
|
|
|
ENV PORT="8000" \
|
|
# Keeps Python from generating .pyc files in the container
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
# Turns off buffering for easier container logging
|
|
PYTHONUNBUFFERED=1
|
|
|
|
# ihatemoney configuration
|
|
ENV DEBUG="False" \
|
|
ACTIVATE_ADMIN_DASHBOARD="False" \
|
|
ACTIVATE_DEMO_PROJECT="True" \
|
|
ADMIN_PASSWORD="" \
|
|
ALLOW_PUBLIC_PROJECT_CREATION="True" \
|
|
BABEL_DEFAULT_TIMEZONE="UTC" \
|
|
GREENLET_TEST_CPP="no" \
|
|
MAIL_DEFAULT_SENDER="('Budget manager', 'budget@notmyidea.org')" \
|
|
MAIL_PASSWORD="" \
|
|
MAIL_PORT="25" \
|
|
MAIL_SERVER="localhost" \
|
|
MAIL_USE_SSL="False" \
|
|
MAIL_USE_TLS="False" \
|
|
MAIL_USERNAME="" \
|
|
SECRET_KEY="tralala" \
|
|
SESSION_COOKIE_SECURE="True" \
|
|
SQLALCHEMY_DATABASE_URI="sqlite:////database/ihatemoney.db" \
|
|
SQLALCHEMY_TRACK_MODIFICATIONS="False" \
|
|
ENABLE_CAPTCHA="False" \
|
|
LEGAL_LINK="False"
|
|
|
|
ADD . /src
|
|
|
|
RUN echo "**** install build dependencies ****" &&\
|
|
apk add --no-cache --virtual=build-dependencies \
|
|
gcc \
|
|
musl-dev \
|
|
postgresql-dev &&\
|
|
echo "**** install runtime packages ****" && \
|
|
apk add --no-cache \
|
|
shadow \
|
|
postgresql-libs && \
|
|
echo "**** create runtime folder ****" && \
|
|
mkdir -p /etc/ihatemoney &&\
|
|
echo "**** install pip packages ****" && \
|
|
pip install --no-cache-dir \
|
|
gunicorn && \
|
|
pip install --no-cache-dir -e /src[database] && \
|
|
echo "**** create user abc:abc ****" && \
|
|
useradd -u 1000 -U -d /src abc && \
|
|
echo "**** cleanup ****" && \
|
|
apk del --purge build-dependencies &&\
|
|
rm -rf \
|
|
/tmp/*
|
|
|
|
VOLUME /database
|
|
EXPOSE ${PORT}
|
|
ENTRYPOINT ["/src/conf/entrypoint.sh"]
|