Skip to content

Commit 25ab0c9

Browse files
authored
Merge pull request #23 from BeNikk/dockerize
Dockerize
2 parents cce7203 + 602edd6 commit 25ab0c9

File tree

6 files changed

+60
-1
lines changed

6 files changed

+60
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ Tech Stack
2121

2222
## Conflict management
2323
Handled via Y.js (CRDT)
24+
25+
## Running the app
26+
docker compose up (--build if image not there)

backend/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
npm-debug.log
3+
dist

backend/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:18
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
RUN npm install
7+
8+
COPY . .
9+
EXPOSE 8080
10+
11+
CMD ["npm","start"]

backend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"start":"npx tsc && node dist/index.js"
89
},
910
"keywords": [],
1011
"author": "",

docker-compose.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: "3.9"
2+
3+
services:
4+
backend:
5+
build: ./backend
6+
container_name: backend
7+
ports:
8+
- "8080:8080"
9+
networks:
10+
- app-network
11+
env_file:
12+
- ./backend/.env
13+
14+
frontend:
15+
build: ./frontend
16+
container_name: frontend
17+
ports:
18+
- "3000:3000"
19+
networks:
20+
- app-network
21+
depends_on:
22+
- backend
23+
env_file:
24+
- ./frontend/.env
25+
networks:
26+
app-network:
27+
driver: bridge

frontend/Dockerfile

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

0 commit comments

Comments
 (0)