Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +12 -48
Dockerfile
CHANGED
|
@@ -1,56 +1,20 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM node:
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
# Install system dependencies required for Playwright
|
| 8 |
-
RUN apt-get update && apt-get install -y \
|
| 9 |
-
git \
|
| 10 |
-
wget \
|
| 11 |
-
curl \
|
| 12 |
-
unzip \
|
| 13 |
-
fonts-liberation \
|
| 14 |
-
libasound2 \
|
| 15 |
-
libatk-bridge2.0-0 \
|
| 16 |
-
libatk1.0-0 \
|
| 17 |
-
libcups2 \
|
| 18 |
-
libdbus-1-3 \
|
| 19 |
-
libgbm-dev \
|
| 20 |
-
libnspr4 \
|
| 21 |
-
libnss3 \
|
| 22 |
-
libxcomposite1 \
|
| 23 |
-
libxdamage1 \
|
| 24 |
-
libxfixes3 \
|
| 25 |
-
libxrandr2 \
|
| 26 |
-
xdg-utils \
|
| 27 |
-
libu2f-udev \
|
| 28 |
-
libvulkan1 \
|
| 29 |
-
xvfb \
|
| 30 |
-
--no-install-recommends && \
|
| 31 |
-
rm -rf /var/lib/apt/lists/*
|
| 32 |
|
| 33 |
-
# Clone
|
| 34 |
RUN git clone https://github.com/Kingdavid102/my-api.git /app
|
| 35 |
|
| 36 |
-
# Set
|
| 37 |
-
RUN chmod -R 777 /app
|
| 38 |
-
|
| 39 |
-
# Install project dependencies
|
| 40 |
WORKDIR /app
|
| 41 |
-
RUN npm install
|
| 42 |
-
|
| 43 |
-
# Set Playwright cache path
|
| 44 |
-
ENV PLAYWRIGHT_BROWSERS_PATH=/home/node/.cache/ms-playwright
|
| 45 |
|
| 46 |
-
# Install
|
| 47 |
-
RUN
|
| 48 |
-
|
| 49 |
-
# Fix permissions for Playwright
|
| 50 |
-
RUN chmod -R 777 /home/node/.cache/ms-playwright
|
| 51 |
|
| 52 |
-
# Expose
|
| 53 |
-
EXPOSE
|
| 54 |
|
| 55 |
-
# Start
|
| 56 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use Node 20 LTS
|
| 2 |
+
FROM node:20-alpine
|
| 3 |
|
| 4 |
+
# Install git
|
| 5 |
+
RUN apk add --no-cache git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# Clone your repo directly into /app
|
| 8 |
RUN git clone https://github.com/Kingdavid102/my-api.git /app
|
| 9 |
|
| 10 |
+
# Set working directory
|
|
|
|
|
|
|
|
|
|
| 11 |
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# Install dependencies
|
| 14 |
+
RUN npm install
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
# Expose app port
|
| 17 |
+
EXPOSE 7860
|
| 18 |
|
| 19 |
+
# Start app
|
| 20 |
+
CMD ["npm", "start"]
|