Add application file
Browse files- Dockerfile +19 -0
Dockerfile
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ==== CONFIGURE =====
|
2 |
+
# Use a Node 16 base image
|
3 |
+
FROM node:16
|
4 |
+
# Set the working directory to /code inside the container
|
5 |
+
WORKDIR /code
|
6 |
+
# Copy app files
|
7 |
+
COPY . .
|
8 |
+
# ==== BUILD =====
|
9 |
+
# Install dependencies (npm ci makes sure the exact versions in the lockfile gets installed)
|
10 |
+
RUN npm ci
|
11 |
+
# Build the app
|
12 |
+
RUN npm run build
|
13 |
+
# ==== RUN =======
|
14 |
+
# Set the env to "production"
|
15 |
+
ENV NODE_ENV production
|
16 |
+
# Expose the port on which the app will be running (3000 is the default that `serve` uses)
|
17 |
+
EXPOSE 7860
|
18 |
+
# Start the app
|
19 |
+
CMD [ "node", "server.js" ]
|