Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +3 -15
Dockerfile
CHANGED
|
@@ -3,31 +3,19 @@ FROM python:3.11-slim
|
|
| 3 |
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
|
| 6 |
-
# Install sistem dependencies
|
| 7 |
RUN apt-get update && \
|
| 8 |
apt-get install -y --no-install-recommends \
|
| 9 |
-
|
| 10 |
-
libcups2 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 libgbm1 \
|
| 11 |
-
libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0 libxshmfence1 \
|
| 12 |
-
libxtst6 libatspi2.0-0 libdrm2 libxkbcommon0 \
|
| 13 |
-
fonts-liberation fonts-noto-core fonts-noto-cjk && \
|
| 14 |
rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
# Install dependencies sebagai root
|
| 17 |
COPY requirements.txt /tmp/requirements.txt
|
| 18 |
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN playwright install chromium
|
| 22 |
-
|
| 23 |
-
# Buat user dengan UID 1000 setelah install browser
|
| 24 |
RUN useradd -m -u 1000 user
|
| 25 |
|
| 26 |
-
# Copy browser ke user directory dan set permission
|
| 27 |
-
RUN mkdir -p /home/user/.cache && \
|
| 28 |
-
cp -r /root/.cache/ms-playwright /home/user/.cache/ && \
|
| 29 |
-
chown -R user:user /home/user/.cache
|
| 30 |
-
|
| 31 |
# Switch ke user dan setup home directory
|
| 32 |
USER user
|
| 33 |
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
|
|
|
|
| 3 |
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
|
| 6 |
+
# Install sistem dependencies
|
| 7 |
RUN apt-get update && \
|
| 8 |
apt-get install -y --no-install-recommends \
|
| 9 |
+
git build-essential && \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Install dependencies sebagai root
|
| 13 |
COPY requirements.txt /tmp/requirements.txt
|
| 14 |
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 15 |
|
| 16 |
+
# Buat user dengan UID 1000
|
|
|
|
|
|
|
|
|
|
| 17 |
RUN useradd -m -u 1000 user
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
# Switch ke user dan setup home directory
|
| 20 |
USER user
|
| 21 |
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
|