-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile Addn PR ( #189 ) from Hamza1821/addedDockerfiles
added dockerfile and docker-compose
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 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,14 @@ | ||
# backend/Dockerfile | ||
FROM node:18 | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["npm", "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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: '3.8' | ||
|
||
services: | ||
backend: | ||
build: | ||
context: ./backend | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- NODE_ENV=production | ||
volumes: | ||
- ./backend:/app | ||
depends_on: | ||
- frontend | ||
|
||
frontend: | ||
build: | ||
context: ./frontend | ||
ports: | ||
- "80:80" | ||
environment: | ||
- NODE_ENV=production | ||
volumes: | ||
- ./frontend:/app |
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,20 @@ | ||
# frontend/Dockerfile | ||
FROM node:18 AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
FROM nginx:stable-alpine AS production | ||
|
||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |