Update Dockerfile
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
|
@@ -6,21 +6,21 @@ RUN apk add --no-cache make gcc g++ python3
|
|
| 6 |
# Create app directory
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
COPY
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Install dependencies
|
| 13 |
-
RUN npm
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
RUN npm
|
| 17 |
|
| 18 |
-
# Rebuild bcrypt
|
| 19 |
RUN npm rebuild bcrypt --build-from-source
|
| 20 |
|
| 21 |
-
# Bundle app source
|
| 22 |
-
COPY . .
|
| 23 |
-
|
| 24 |
# Create the dist directory and set permissions
|
| 25 |
RUN mkdir -p /app/dist && chown -R node:node /app
|
| 26 |
|
|
@@ -31,4 +31,4 @@ USER node
|
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
# Command to run the application
|
| 34 |
-
CMD ["npm", "run", "start:dev"]
|
|
|
|
| 6 |
# Create app directory
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# Copy all application files
|
| 10 |
+
COPY . .
|
| 11 |
+
|
| 12 |
+
# Remove existing node_modules (if any)
|
| 13 |
+
RUN rm -rf node_modules
|
| 14 |
|
| 15 |
# Install dependencies
|
| 16 |
+
RUN npm ci
|
| 17 |
|
| 18 |
+
# Build the application
|
| 19 |
+
RUN npm run build
|
| 20 |
|
| 21 |
+
# Rebuild bcrypt (if necessary)
|
| 22 |
RUN npm rebuild bcrypt --build-from-source
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
# Create the dist directory and set permissions
|
| 25 |
RUN mkdir -p /app/dist && chown -R node:node /app
|
| 26 |
|
|
|
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
# Command to run the application
|
| 34 |
+
CMD ["npm", "run", "start:dev"]
|