-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·40 lines (31 loc) · 913 Bytes
/
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
FROM python:3.12
# this can be configurable with docker build args but not implemented in tasks.json yet
ARG UID=1000
ARG GID=1000
RUN set -ex \
&& apt-get update \
&& apt-get install -y \
default-jre-headless \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -g ${GID} dev && \
useradd -m -s /usr/sbin/nologin -u ${UID} -g dev dev
RUN mkdir -p /home/dev/containerized-python
WORKDIR /home/dev/containerized-python
RUN pip install --upgrade build
COPY ./.cache ../.cache/
RUN chown -R dev:dev ../.cache
COPY ./build ./build/
COPY ./dist ./dist/
COPY ./src ./src/
COPY setup.py pyproject.toml \
./
RUN chown -R dev:dev .
USER dev
RUN python -m build
RUN pip install .
CMD [ "sh", "-c", \
"python -m 'main'" \
]
# docker build . --no-cache --progress=plain --tag=containerized-python
# docker build . --tag=containerized-python
# docker run --rm -it containerized-python:latest