forked from ChicoState/Odd-Jobs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added working dockerfile and .dockerignore
- Loading branch information
Showing
2 changed files
with
20 additions
and
5 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
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,9 +1,23 @@ | ||
FROM node:16-alpine as builder | ||
WORKDIR '/oddjobs' | ||
COPY package.json . | ||
# Use an official Node runtime as a parent image | ||
FROM node:16 | ||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
|
||
# Copy the package.json and package-lock.json to the working directory | ||
COPY ./package*.json ./ | ||
|
||
# Install the dependencies | ||
RUN npm install | ||
|
||
# Copy the remaining application files to the working directory | ||
COPY . . | ||
|
||
# Build the application | ||
RUN npm run build | ||
|
||
FROM nginx | ||
COPY --from=builder /app/build /usr/share/nginx/html | ||
# Expose port 3000 for the application | ||
EXPOSE 3000 | ||
|
||
# Start the application | ||
CMD [ "npm", "run", "start" ] |