-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
37 lines (25 loc) · 774 Bytes
/
Copy pathDockerfile.dev
File metadata and controls
37 lines (25 loc) · 774 Bytes
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
FROM python:3.11-slim
ARG UID
ARG GID
ARG POETRY_VERSION
WORKDIR /src
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git libmagic-dev build-essential curl \
&& rm -rf /var/lib/apt/lists/*
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=. \
POETRY_VERSION=${POETRY_VERSION}
RUN pip install -U pip setuptools "poetry==$POETRY_VERSION"
COPY *.toml *.lock ./
RUN poetry config virtualenvs.create false
RUN poetry export --dev --with-credentials --without-hashes -f \
requirements.txt --output requirements.txt && \
pip install -r requirements.tx
COPY . /src
EXPOSE 8000
ENV PIP_EXTRA_INDEX_URL=""
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
RUN chown -R appuser:appgroup /src
USER appuser