forked from spiral-project/ihatemoney
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (53 loc) · 1.67 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 <admin@example.com>" \
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" \
SHOW_ADMIN_EMAIL="True" \
SQLALCHEMY_DATABASE_URI="sqlite:////database/ihatemoney.db" \
SQLALCHEMY_TRACK_MODIFICATIONS="False" \
ENABLE_CAPTCHA="False" \
LEGAL_LINK=""
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"]