-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (16 loc) · 775 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (16 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM python:3.11-alpine
RUN addgroup -S wsgi-echo-server \
&& adduser -G wsgi-echo-server -S wsgi-echo-server \
&& mkdir /app \
&& chown -R wsgi-echo-server:wsgi-echo-server /app
RUN apk add --no-cache --virtual .uwsgi-build-deps gcc python3-dev build-base linux-headers \
&& apk add --no-cache --virtual .uwsgi-runtime-deps pcre-dev \
&& pip install --no-warn-script-location --no-cache --upgrade pip poetry uwsgi \
&& apk del .uwsgi-build-deps
USER wsgi-echo-server:wsgi-echo-server
WORKDIR /app
COPY pyproject.toml .
RUN poetry config virtualenvs.in-project true \
&& poetry install --no-root --only=main
COPY wsgi_echo_server.py ./
ENTRYPOINT ["uwsgi", "--module=wsgi_echo_server", "--virtualenv=.venv", "--uid=nobody", "--gid=nobody"]