-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (29 loc) · 1.1 KB
/
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
41
42
43
44
45
46
47
FROM python:3.11.4-bullseye
ARG UID
ARG GID
ARG USER
ARG PROJ
# Update the package list, install sudo, create a non-root user, and grant password-less sudo permissions
RUN apt update && \
apt install -y sudo && \
addgroup --gid $GID nonroot && \
adduser --uid $UID --gid $GID --disabled-password --gecos "" $USER && \
echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER
# echo '$USER ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# no need to create virtual environment since the docker containr is already is
ENV POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_CREATE=false
ENV PATH="$POETRY_HOME/bin:$PATH"
RUN apt-get update && \
apt-get install --no-install-recommends -y build-essential
RUN curl -sSL https://install.python-poetry.org | python3 -
COPY pyproject.toml ./
RUN poetry install
EXPOSE 8888
USER $USER
WORKDIR /home/$USER/$PROJ
RUN sudo playwright install --with-deps chromium && \
mkdir -p /home/$USER/.cache && \
sudo mv /root/.cache/ms-playwright /home/$USER/.cache && \
sudo chown -R $USER /home/$USER/.cache/ms-playwright
CMD ["bash"]