-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (26 loc) · 906 Bytes
/
Dockerfile
File metadata and controls
34 lines (26 loc) · 906 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
FROM python:3.13-slim
ENV WEBSHOOTER_DOCKER=yes
ARG USER=websh
ARG UID=54321
# add new user
RUN groupadd --gid $UID $USER && \
useradd --shell /bin/bash --create-home --home-dir /web --uid $UID --gid $UID $USER
USER $USER
WORKDIR /web
# install python dependencies in a virtualenv
ADD --chown=$USER:$USER requirements.txt ./
RUN python -m venv .webshooter && \
. .webshooter/bin/activate && \
pip install --no-cache-dir -r requirements.txt && \
echo >> .bashrc && \
echo ". .webshooter/bin/activate" >> .bashrc
# copy the app and install
ADD --chown=$USER:$USER . ./
RUN . .webshooter/bin/activate && \
pip install .
# allow running the container as a different user
#RUN chmod -R o+rw ./
# can run "python3 -m http.server" to browse html report at "http://localhost:8000/page.0.html"
# docker run -p 127.0.0.1:8000:8000/tcp -it IMAGE
EXPOSE 8000
ENTRYPOINT [ "/bin/bash" ]