-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bfix: Updates production dockerfile (#135)
- Loading branch information
1 parent
0b10897
commit d8699c7
Showing
2 changed files
with
14 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
FROM node:latest as build | ||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
WORKDIR /app | ||
|
||
COPY package.json package-lock.json ./ | ||
# Copy package.json and package-lock.json | ||
COPY package*.json / | ||
|
||
RUN npm install | ||
# Install dependencies | ||
RUN npm ci | ||
|
||
COPY . ./ | ||
# Copy the rest of the code | ||
COPY . . | ||
|
||
RUN npm run build | ||
# Build the app | ||
RUN npm run build | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 3000 | ||
|
||
FROM nginx:alpine | ||
|
||
COPY --from=build /app/build /usr/share/nginx/html | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
# Start the application | ||
CMD ["npm", "run","start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,3 @@ services: | |
- "8081:3000" | ||
volumes: | ||
- .:/app | ||
stdin_open: true | ||
tty: true |