Skip to content

Commit c55b4a0

Browse files
dx: Dockerfile added (#208)
Co-authored-by: Krish Gupta <[email protected]>
1 parent 22835d5 commit c55b4a0

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:16.17.0-alpine
2+
WORKDIR '/app'
3+
4+
COPY package.json .
5+
RUN npm install
6+
COPY . .
7+
8+
CMD ["npm","run","dev"]
9+
10+
11+
12+
# if facing error while building image, paste there two command in terminal.
13+
14+
# export DOCKER_BUILDKIT=0
15+
#export COMPOSE_DOCKER_CLI_BUILD=0

docker-compose.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: "3"
2+
services:
3+
react-app:
4+
restart: always
5+
build:
6+
context: ./
7+
dockerfile: Dockerfile
8+
image: amazon-clone
9+
stdin_open: true
10+
ports:
11+
- "3000:3000"
12+
networks:
13+
- app
14+
volumes:
15+
- ./src:/app/src
16+
- ./app/node_modules
17+
18+
networks:
19+
app:
20+
driver: bridge

0 commit comments

Comments
 (0)