Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +27 -21
Dockerfile
CHANGED
|
@@ -1,32 +1,38 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
-
sudo \
|
| 8 |
curl \
|
| 9 |
wget \
|
| 10 |
git \
|
| 11 |
-
|
| 12 |
-
zip \
|
| 13 |
nano \
|
| 14 |
vim \
|
|
|
|
|
|
|
| 15 |
python3 \
|
| 16 |
python3-pip \
|
| 17 |
python3-venv \
|
|
|
|
|
|
|
| 18 |
chromium \
|
| 19 |
chromium-driver \
|
| 20 |
ca-certificates \
|
| 21 |
-
|
| 22 |
&& rm -rf /var/lib/apt/lists/*
|
| 23 |
|
| 24 |
# Install Node.js 20
|
| 25 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
|
|
| 26 |
apt-get install -y nodejs && \
|
| 27 |
-
apt-get clean && \
|
| 28 |
rm -rf /var/lib/apt/lists/*
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
# Upgrade pip
|
| 31 |
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 32 |
|
|
@@ -36,10 +42,12 @@ RUN pip3 install --no-cache-dir \
|
|
| 36 |
webdriver-manager \
|
| 37 |
fake-useragent \
|
| 38 |
requests \
|
| 39 |
-
beautifulsoup4 \
|
| 40 |
-
flask \
|
| 41 |
aiohttp \
|
|
|
|
| 42 |
lxml \
|
|
|
|
|
|
|
|
|
|
| 43 |
python-dotenv \
|
| 44 |
rich
|
| 45 |
|
|
@@ -49,22 +57,20 @@ RUN npm install -g \
|
|
| 49 |
yarn \
|
| 50 |
typescript \
|
| 51 |
ts-node \
|
| 52 |
-
nodemon
|
| 53 |
-
|
| 54 |
-
# Environment variables for Selenium
|
| 55 |
-
ENV CHROME_BIN=/usr/bin/chromium
|
| 56 |
-
ENV CHROMEDRIVER=/usr/bin/chromedriver
|
| 57 |
|
| 58 |
-
#
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
# Workspace
|
| 62 |
-
RUN mkdir -p /home/coder/project && \
|
| 63 |
-
chown -R coder:coder /home/coder/project
|
| 64 |
|
| 65 |
USER coder
|
| 66 |
WORKDIR /home/coder/project
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
EXPOSE 7680
|
| 69 |
|
| 70 |
-
CMD ["
|
|
|
|
| 1 |
+
FROM debian:bookworm-slim
|
| 2 |
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
ENV PORT=7680
|
| 5 |
|
| 6 |
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 8 |
curl \
|
| 9 |
wget \
|
| 10 |
git \
|
| 11 |
+
sudo \
|
|
|
|
| 12 |
nano \
|
| 13 |
vim \
|
| 14 |
+
unzip \
|
| 15 |
+
zip \
|
| 16 |
python3 \
|
| 17 |
python3-pip \
|
| 18 |
python3-venv \
|
| 19 |
+
python3-dev \
|
| 20 |
+
build-essential \
|
| 21 |
chromium \
|
| 22 |
chromium-driver \
|
| 23 |
ca-certificates \
|
| 24 |
+
gnupg \
|
| 25 |
&& rm -rf /var/lib/apt/lists/*
|
| 26 |
|
| 27 |
# Install Node.js 20
|
| 28 |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 29 |
+
apt-get update && \
|
| 30 |
apt-get install -y nodejs && \
|
|
|
|
| 31 |
rm -rf /var/lib/apt/lists/*
|
| 32 |
|
| 33 |
+
# Install code-server
|
| 34 |
+
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 35 |
+
|
| 36 |
# Upgrade pip
|
| 37 |
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 38 |
|
|
|
|
| 42 |
webdriver-manager \
|
| 43 |
fake-useragent \
|
| 44 |
requests \
|
|
|
|
|
|
|
| 45 |
aiohttp \
|
| 46 |
+
beautifulsoup4 \
|
| 47 |
lxml \
|
| 48 |
+
flask \
|
| 49 |
+
fastapi \
|
| 50 |
+
uvicorn \
|
| 51 |
python-dotenv \
|
| 52 |
rich
|
| 53 |
|
|
|
|
| 57 |
yarn \
|
| 58 |
typescript \
|
| 59 |
ts-node \
|
| 60 |
+
nodemon \
|
| 61 |
+
pm2
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
+
# Create non-root user
|
| 64 |
+
RUN useradd -m -s /bin/bash coder && \
|
| 65 |
+
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
USER coder
|
| 68 |
WORKDIR /home/coder/project
|
| 69 |
|
| 70 |
+
# Environment variables for Selenium
|
| 71 |
+
ENV CHROME_BIN=/usr/bin/chromium
|
| 72 |
+
ENV CHROMEDRIVER=/usr/bin/chromedriver
|
| 73 |
+
|
| 74 |
EXPOSE 7680
|
| 75 |
|
| 76 |
+
CMD ["sh", "-c", "code-server --bind-addr 0.0.0.0:${PORT} --auth none /home/coder/project"]
|