Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -3
Dockerfile
CHANGED
|
@@ -3,7 +3,13 @@ FROM ubuntu:24.04
|
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
| 4 |
TZ=Europe/Paris
|
| 5 |
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
|
| 8 |
&& echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
| 9 |
|
|
@@ -13,7 +19,7 @@ RUN mkdir -p /home/user/app /home/user/.cache /home/user/.config \
|
|
| 13 |
&& chown -R user:user /home/user \
|
| 14 |
&& chmod -R 777 /home/user
|
| 15 |
|
| 16 |
-
#
|
| 17 |
COPY setup.sh /home/user/app/setup.sh
|
| 18 |
RUN chmod +x /home/user/app/setup.sh && /home/user/app/setup.sh
|
| 19 |
|
|
@@ -24,7 +30,7 @@ USER user
|
|
| 24 |
COPY --chown=user start.sh /home/user/app/start.sh
|
| 25 |
RUN chmod +x /home/user/app/start.sh
|
| 26 |
|
| 27 |
-
#
|
| 28 |
COPY --chown=user . /home/user/app
|
| 29 |
|
| 30 |
ENV PYTHONUNBUFFERED=1 \
|
|
|
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
| 4 |
TZ=Europe/Paris
|
| 5 |
|
| 6 |
+
# 先安裝建立使用者需要的套件
|
| 7 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
+
adduser \
|
| 9 |
+
sudo \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# 建立 user
|
| 13 |
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
|
| 14 |
&& echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
| 15 |
|
|
|
|
| 19 |
&& chown -R user:user /home/user \
|
| 20 |
&& chmod -R 777 /home/user
|
| 21 |
|
| 22 |
+
# 複製安裝腳本並執行 (root)
|
| 23 |
COPY setup.sh /home/user/app/setup.sh
|
| 24 |
RUN chmod +x /home/user/app/setup.sh && /home/user/app/setup.sh
|
| 25 |
|
|
|
|
| 30 |
COPY --chown=user start.sh /home/user/app/start.sh
|
| 31 |
RUN chmod +x /home/user/app/start.sh
|
| 32 |
|
| 33 |
+
# 複製應用程式
|
| 34 |
COPY --chown=user . /home/user/app
|
| 35 |
|
| 36 |
ENV PYTHONUNBUFFERED=1 \
|