Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +16 -17
Dockerfile
CHANGED
@@ -1,30 +1,29 @@
|
|
1 |
-
# Use Node.js 18 base image
|
2 |
FROM node:20
|
3 |
|
4 |
-
#
|
5 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Set working directory
|
8 |
WORKDIR /usr/src/app
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
RUN npm install
|
13 |
-
RUN npm install chrome-lens-ocr node-fetch sharp
|
14 |
-
# If building for production, use:
|
15 |
-
# RUN npm ci --only=production
|
16 |
|
17 |
-
# Copy application source code
|
18 |
-
COPY . .
|
19 |
|
20 |
-
#
|
|
|
21 |
RUN chown -R appuser:appuser /usr/src/app
|
22 |
-
|
23 |
-
# Switch to the non-root user
|
24 |
USER appuser
|
25 |
|
26 |
-
# Expose the
|
27 |
-
EXPOSE
|
28 |
|
29 |
-
#
|
30 |
-
CMD ["
|
|
|
|
|
1 |
FROM node:20
|
2 |
|
3 |
+
# Install git
|
4 |
+
RUN apt-get update && apt-get install -y git
|
5 |
+
|
6 |
+
# Set build argument for GitHub token
|
7 |
+
ARG GITHUB_TOKEN
|
8 |
+
|
9 |
+
# Clone the private repo using the token
|
10 |
+
RUN git clone https://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@github.com/viratxd/prompt-glow-lab-00.git /usr/src/app
|
11 |
|
12 |
# Set working directory
|
13 |
WORKDIR /usr/src/app
|
14 |
|
15 |
+
# Install dependencies
|
16 |
+
|
17 |
RUN npm install
|
|
|
|
|
|
|
18 |
|
|
|
|
|
19 |
|
20 |
+
# Create and switch to non-root user
|
21 |
+
RUN groupadd -r appuser && useradd -r -g appuser appuser
|
22 |
RUN chown -R appuser:appuser /usr/src/app
|
|
|
|
|
23 |
USER appuser
|
24 |
|
25 |
+
# Expose the development port
|
26 |
+
EXPOSE 3000
|
27 |
|
28 |
+
# Start development server
|
29 |
+
CMD ["npm", "run", "dev"]
|