Spaces:
Running
Running
Commit
·
3227eb4
1
Parent(s):
19ebf44
update: config
Browse files- Dockerfile +6 -2
Dockerfile
CHANGED
@@ -1,17 +1,19 @@
|
|
1 |
# Use the official Node.js v18 image as the base image
|
2 |
FROM node:18
|
3 |
|
|
|
|
|
4 |
# Set the working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Copy package.json and package-lock.json to the working directory
|
8 |
-
COPY package*.json ./
|
9 |
|
10 |
# Install dependencies
|
11 |
RUN npm install
|
12 |
|
13 |
# Copy the entire application code to the working directory
|
14 |
-
COPY . .
|
15 |
|
16 |
# remove .env file if it exists
|
17 |
RUN rm -f -- .env
|
@@ -19,6 +21,8 @@ RUN rm -f -- .env
|
|
19 |
# Build the TypeScript code
|
20 |
#RUN npm run build
|
21 |
|
|
|
|
|
22 |
# Set the PORT environment variable
|
23 |
ENV PORT=7860
|
24 |
ARG JWT_SECRET
|
|
|
1 |
# Use the official Node.js v18 image as the base image
|
2 |
FROM node:18
|
3 |
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
+
|
6 |
# Set the working directory inside the container
|
7 |
WORKDIR /app
|
8 |
|
9 |
# Copy package.json and package-lock.json to the working directory
|
10 |
+
COPY --chown=user package*.json ./
|
11 |
|
12 |
# Install dependencies
|
13 |
RUN npm install
|
14 |
|
15 |
# Copy the entire application code to the working directory
|
16 |
+
COPY --chown=user . .
|
17 |
|
18 |
# remove .env file if it exists
|
19 |
RUN rm -f -- .env
|
|
|
21 |
# Build the TypeScript code
|
22 |
#RUN npm run build
|
23 |
|
24 |
+
USER user
|
25 |
+
|
26 |
# Set the PORT environment variable
|
27 |
ENV PORT=7860
|
28 |
ARG JWT_SECRET
|