Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# ADD DOCKERFILE CONTENTS HERE
FROM node:18 AS builder

WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

FROM nginx:alpine

COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
Binary file added ReactJS_Project.zip
Binary file not shown.
10 changes: 9 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# ADD DOCKER-COMPOSE CONTENTS HERE
version: "3.9"

services:
react-frontend:
build: .
container_name: react_frontend
ports:
- "8080:80"
restart: unless-stopped
12 changes: 11 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# ADD NGINX CONTENTS HERE
server {
listen 80;
server_name localhost;

root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri /index.html;
}
}