forked from psono/psono-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfileAlpine
51 lines (44 loc) · 1.56 KB
/
DockerfileAlpine
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
# PSONO Dockerfile for Alpine
FROM psono-docker.jfrog.io/python:3.11.3-alpine3.16
LABEL maintainer="Sascha Pfeiffer <[email protected]>"
COPY psono/static/email /var/www/html/static/email
COPY . /root/
ENV PYTHONUNBUFFERED True
WORKDIR /root
# Buildkit should populate this on build with e.g. "arm64" or "amd64"
ARG TARGETARCH
RUN apk upgrade && \
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 \
gettext \
ca-certificates \
curl \
postgresql-dev && \
apk add --virtual .build-deps \
build-base \
libffi-dev \
linux-headers && \
pip3 install --upgrade pip && \
pip3 install -r requirements.txt && \
if [ "$TARGETARCH" = "amd64" ]; then \
pip3 install -r requirements-amd64.txt ; \
fi; \
pip3 install uwsgi && \
mkdir -p /root/.psono_server && \
cp /root/configs/mainconfig/settings.yaml /root/.psono_server/settings.yaml && \
sed -i /root/.psono_server/settings.yaml \
-e "s/YourPostgresDatabase/postgres/g " \
-e "s/YourPostgresUser/postgres/g" \
-e "s/YourPostgresHost/postgres/g" \
-e "s/YourPostgresPort/5432/g" \
-e "s,path/to/psono-server,root,g" && \
apk del .build-deps && \
rm -Rf \
/root/.cache \
/var/cache/apk/*
HEALTHCHECK --interval=2m --timeout=3s \
CMD curl -f http://localhost/healthcheck/ || exit 1
EXPOSE 80
CMD ["/bin/sh", "/root/configs/docker/cmd.sh"]