Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM mcr.microsoft.com/playwright:focal
|
| 2 |
+
|
| 3 |
+
# Skip Playwright browser downloads
|
| 4 |
+
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
| 5 |
+
|
| 6 |
+
# Set timezone
|
| 7 |
+
ENV TZ=Asia/Jakarta
|
| 8 |
+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
| 9 |
+
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
|
| 12 |
+
# Clone repository
|
| 13 |
+
RUN --mount=type=secret,id=GITHUB_REPO,required=true \
|
| 14 |
+
git clone $(cat /run/secrets/GITHUB_REPO) .
|
| 15 |
+
|
| 16 |
+
# Install dependencies
|
| 17 |
+
RUN npm install
|
| 18 |
+
|
| 19 |
+
# Install Playwright dependencies and browsers
|
| 20 |
+
RUN npx playwright install --with-deps
|
| 21 |
+
|
| 22 |
+
# Set environment variable for the app port
|
| 23 |
+
ENV PORT=7860
|
| 24 |
+
|
| 25 |
+
# Expose the port
|
| 26 |
+
EXPOSE 7860
|
| 27 |
+
|
| 28 |
+
# Start the application
|
| 29 |
+
CMD ["node", "app.js"]
|