Skip to content

Commit

Permalink
Merge pull request Trisha-tech#143 from swataswayam-14/master
Browse files Browse the repository at this point in the history
Added Dockerfile for server and client setup
  • Loading branch information
Trisha-tech committed May 23, 2024
2 parents 022c827 + 1b61349 commit 7d65a86
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:21

WORKDIR /expressapp

COPY package* .

RUN npm install

COPY . .

# Set the DATABASE_URL environment variable from the .env file
ENV MONGO_URL=${MONGO_URL}

CMD ["npm", "run", "start"]
19 changes: 19 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:14 as build

WORKDIR /app

COPY package*.json ./

RUN npm ci

COPY . .

RUN npm run build

FROM nginx:alpine

COPY --from=build /app/build /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 7d65a86

Please sign in to comment.