-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
60 lines (50 loc) · 1.33 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
59
60
FROM surnet/alpine-wkhtmltopdf:3.16.2-0.12.6-full as wkhtmltopdf
FROM python:3.10-alpine3.16
# Install dependencies
RUN apk add --no-cache \
libstdc++ \
libx11 \
libxrender \
libxext \
libssl1.1 \
ca-certificates \
fontconfig \
freetype \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation \
build-base \
postgresql-dev \
gcc \
openssl-dev \
openssl \
curl \
sqlite-libs>=3.40.1-r0 \
# more fonts
&& apk add --no-cache --virtual .build-deps \
msttcorefonts-installer \
# Install microsoft fonts
&& update-ms-fonts \
&& fc-cache -f \
# Clean up when done
&& rm -rf /tmp/* \
&& apk del .build-deps
# Copy wkhtmltopdf files from docker-wkhtmltopdf image
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/wkhtmltoimage /bin/wkhtmltoimage
COPY --from=wkhtmltopdf /bin/libwkhtmltox* /bin/
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install --upgrade pip && pip install wheel>=0.38.4 && pip install -r requirements.txt
ADD ./ .
ENV PYTHONPATH "#{PYTHONPATH}:/app"
RUN addgroup \
--gid 1000 \
-S solarpark-service
RUN adduser \
--uid 1000 \
-G solarpark-service \
-S solarpark-service
USER solarpark-service
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]