-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
37 lines (26 loc) · 1.05 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
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.12-alpine AS base
# Keeps Python from generating .pyc files in the container
# Turns off buffering for easier container logging
# Prevents poetry from creating a virtualenv
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1 \
POETRY_VERSION=1.7.1 \
POETRY_VIRTUALENVS_CREATE=false \
PYTHONDONTWRITEBYTECODE=1
COPY ["poetry.lock", "pyproject.toml", "./"]
RUN apk add --no-cache mariadb-dev \
&& apk add --no-cache --virtual build-dependencies gcc git libc-dev linux-headers \
&& pip install --no-cache-dir "poetry==$POETRY_VERSION"
# Install pip requirements
RUN poetry install --without=dev --no-root --no-interaction --no-ansi \
&& apk del --purge build-dependencies
COPY server-conf/bapi_uwsgi.ini /etc/uwsgi/uwsgi.ini
WORKDIR /app
COPY /src /app
RUN adduser -u 82 -D -S -G www-data www-data \
&& chown -R www-data:www-data /app
USER www-data:www-data
EXPOSE 8081
CMD ["/usr/local/bin/uwsgi", "--ini", "/etc/uwsgi/uwsgi.ini"]