Skip to content

Commit 2fd005e

Browse files
authored
Merge pull request #39 from apsinghdev/Dockerize
Dockerize
2 parents 0006f69 + 4ff86e9 commit 2fd005e

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

api/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:21.6.0-alpine
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
EXPOSE 8000
12+
13+
CMD ["npm", "run", "server"]

client/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:21.6.0-alpine AS build
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
EXPOSE 5173
12+
13+
CMD ["npm", "run", "dev"]

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "vite",
7+
"dev": "vite --host",
88
"build": "vite build",
99
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
1010
"preview": "vite preview"

docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: '3.8'
2+
3+
services:
4+
backend:
5+
build:
6+
context: ./api
7+
dockerfile: Dockerfile
8+
image: rtc-api:1.0
9+
ports:
10+
- "8000:8000"
11+
volumes:
12+
- ./api:/usr/src/app
13+
networks:
14+
- my-network
15+
16+
frontend:
17+
build:
18+
context: ./client
19+
dockerfile: Dockerfile
20+
image: rtc-client:1.1
21+
ports:
22+
- "5173:5173"
23+
volumes:
24+
- ./client:/usr/src/app
25+
networks:
26+
- my-network
27+
28+
networks:
29+
my-network:
30+
driver: bridge

0 commit comments

Comments
 (0)