forked from alexziskind1/codeneedle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (26 loc) · 750 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (26 loc) · 750 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
FROM python:3.14-alpine AS executor
WORKDIR /app
RUN apk --no-cache add \
envsubst \
shadow \
uv \
bash
RUN useradd -m admin
COPY requirements.txt /tmp/requirements.txt
RUN uv pip install --system -r /tmp/requirements.txt
ENV RUN_CMD="bash"
ENTRYPOINT ["sh", "-c", "\
if [ $0 != sh ] || [ $# -gt 0 ];then \
export RUN_CMD=\"$0 $@\"; \
fi; \
if [ $(stat -c '%u' /app) -eq 0 ]; then \
${RUN_CMD}; \
else \
groupmod -g $(stat -c '%u' /app) admin; \
usermod -u $(stat -c '%u' /app) -g $(stat -c '%u' /app) admin; \
ln -s /app/.bash_history /home/admin/.bash_history; \
chown admin:admin /home/admin; \
su admin -c '${RUN_CMD}'; \
fi \
"]
CMD []