Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +10 -1
Dockerfile
CHANGED
|
@@ -1,11 +1,20 @@
|
|
| 1 |
FROM node:18-slim
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /usr/src/app
|
| 4 |
|
|
|
|
| 5 |
COPY package*.json ./
|
| 6 |
|
|
|
|
| 7 |
RUN npm install
|
| 8 |
|
|
|
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
| 1 |
FROM node:18-slim
|
| 2 |
|
| 3 |
+
# Create the log and db directories and set permissions
|
| 4 |
+
RUN mkdir -p /usr/src/app/log /usr/src/app/db && \
|
| 5 |
+
chown -R node:node /usr/src/app/log /usr/src/app/db
|
| 6 |
+
|
| 7 |
+
# Set the working directory
|
| 8 |
WORKDIR /usr/src/app
|
| 9 |
|
| 10 |
+
# Copy package.json and package-lock.json first
|
| 11 |
COPY package*.json ./
|
| 12 |
|
| 13 |
+
# Install dependencies
|
| 14 |
RUN npm install
|
| 15 |
|
| 16 |
+
# Copy the rest of your application files
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
+
# Command to run your application
|
| 20 |
+
CMD ["node", "index.js"]
|