-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (55 loc) · 1.67 KB
/
Dockerfile
File metadata and controls
65 lines (55 loc) · 1.67 KB
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
61
62
63
64
65
FROM --platform=$BUILDPLATFORM python:3.12.9-slim-bookworm
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM with $TARGETARCH"
RUN <<EOF
set -eux
groupadd --gid 1000 python
useradd --uid 1000 --gid python --create-home --shell /bin/sh python
EOF
# ensure correct python version for pipx
RUN python -m pip install pipx
RUN <<EOF
set -eux
apt-get update
apt-get install --assume-yes --no-install-recommends wget
mkdir -p -m 755 /etc/apt/keyrings && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
apt-get update
apt-get install --assume-yes --no-install-recommends dumb-init \
nodejs \
npm \
unzip \
jq \
vim-tiny \
curl \
git \
gh \
libbz2-dev \
libsqlite3-dev \
rabbitmq-server \
make
rm -rf /var/lib/apt/lists/*
apt-get clean
EOF
RUN npm install -g azurite
USER python
VOLUME /home/python
ENV PATH=/home/python/.local/bin:$PATH
RUN pipx install poetry==2.1.1 && \
pipx install nox
RUN cat <<EOF
Version Info:
Python $(python --version)
node $(node --version)
npm $(npm --version)
pipx $(pipx --version)
poetry $(poetry --version)
gh cli $(gh --version)
git $(git --version)
EOF
EXPOSE 8000
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["python"]