Spaces:
Runtime error
Runtime error
GPT-free-api
commited on
Commit
•
8a4cdfe
1
Parent(s):
831b961
Update Dockerfile
Browse files- Dockerfile +20 -12
Dockerfile
CHANGED
@@ -1,26 +1,34 @@
|
|
1 |
-
#
|
2 |
FROM node:20-buster
|
3 |
|
4 |
-
#
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
8 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
#
|
11 |
RUN git clone https://github.com/libredirect/browser_extension
|
12 |
|
13 |
-
#
|
14 |
WORKDIR /app/browser_extension
|
15 |
|
16 |
-
#
|
17 |
RUN npm install
|
18 |
|
19 |
-
#
|
20 |
RUN npm run html
|
21 |
|
22 |
-
#
|
23 |
-
EXPOSE
|
24 |
|
25 |
-
#
|
26 |
-
|
|
|
|
|
|
|
|
1 |
+
# Base image with Node.js
|
2 |
FROM node:20-buster
|
3 |
|
4 |
+
# Create work directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Install dependencies
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
git \
|
10 |
+
firefox-esr \
|
11 |
+
curl \
|
12 |
+
libx11-xcb1 \
|
13 |
+
libdbus-glib-1-2
|
14 |
|
15 |
+
# Clone the repository
|
16 |
RUN git clone https://github.com/libredirect/browser_extension
|
17 |
|
18 |
+
# Change to project directory
|
19 |
WORKDIR /app/browser_extension
|
20 |
|
21 |
+
# Install npm dependencies
|
22 |
RUN npm install
|
23 |
|
24 |
+
# Generate HTML files
|
25 |
RUN npm run html
|
26 |
|
27 |
+
# Expose necessary ports
|
28 |
+
EXPOSE 9222
|
29 |
|
30 |
+
# Add healthcheck
|
31 |
+
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s CMD curl --fail http://127.0.0.1:9222 || exit 1
|
32 |
+
|
33 |
+
# Start Firefox and web-ext
|
34 |
+
CMD /usr/bin/firefox-esr --headless --remote-debugging-port=9222 & sleep 5 && npx web-ext run --firefox /usr/bin/firefox-esr --firefox-profile /tmp/firefox-profile --verbose
|