Spaces:
Running
Running
build command
Browse files- Dockerfile +19 -6
Dockerfile
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
|
|
| 1 |
|
| 2 |
-
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
RUN npm run build
|
| 11 |
|
|
|
|
| 12 |
EXPOSE 3000
|
| 13 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile
|
| 2 |
|
| 3 |
+
# Use an official Node.js runtime as the base image
|
| 4 |
+
FROM node:18
|
| 5 |
+
USER 1000
|
| 6 |
|
| 7 |
+
# Set the working directory in the container
|
| 8 |
+
WORKDIR /usr/src/app
|
| 9 |
|
| 10 |
+
# Copy package.json and package-lock.json to the container
|
| 11 |
+
COPY --chown=1000 package.json package-lock.json ./
|
| 12 |
|
| 13 |
+
# Install dependencies
|
| 14 |
+
RUN npm install
|
| 15 |
+
|
| 16 |
+
# Copy the rest of the application files to the container
|
| 17 |
+
COPY --chown=1000 . .
|
| 18 |
+
|
| 19 |
+
# Build the Svelte Kit application for production
|
| 20 |
RUN npm run build
|
| 21 |
|
| 22 |
+
# Expose the application port (assuming your app runs on port 3000)
|
| 23 |
EXPOSE 3000
|
| 24 |
+
|
| 25 |
+
# Run the application in production mode
|
| 26 |
+
CMD ["node", "build/index.js"]
|