Skip to content

Commit

Permalink
added working dockerfile and .dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeD76 committed Oct 8, 2024
1 parent 826e68c commit 679bf13
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
24 changes: 19 additions & 5 deletions Dockerfile
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" ]

0 comments on commit 679bf13

Please sign in to comment.