Skip to content

Commit d8699c7

Browse files
authored
bfix: Updates production dockerfile (#135)
1 parent 0b10897 commit d8699c7

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

Dockerfile

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
FROM node:latest as build
1+
FROM node:18-alpine
22

3-
WORKDIR /app
3+
WORKDIR /app
44

5-
COPY package.json package-lock.json ./
5+
# Copy package.json and package-lock.json
6+
COPY package*.json /
67

7-
RUN npm install
8+
# Install dependencies
9+
RUN npm ci
810

9-
COPY . ./
11+
# Copy the rest of the code
12+
COPY . .
1013

11-
RUN npm run build
14+
# Build the app
15+
RUN npm run build
1216

17+
# Expose the port the app runs on
18+
EXPOSE 3000
1319

14-
FROM nginx:alpine
15-
16-
COPY --from=build /app/build /usr/share/nginx/html
17-
18-
EXPOSE 80
19-
20-
CMD ["nginx", "-g", "daemon off;"]
20+
# Start the application
21+
CMD ["npm", "run","start"]

docker-compose.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ services:
1111
- "8081:3000"
1212
volumes:
1313
- .:/app
14-
stdin_open: true
15-
tty: true

0 commit comments

Comments
 (0)