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
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# ADD DOCKERFILE CONTENTS HERE
# ADD DOCKERFILE CONTENTS HERE
FROM node:20-alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build
23 changes: 22 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
# ADD DOCKER-COMPOSE CONTENTS HERE
# ADD DOCKER-COMPOSE CONTENTS HERE
version: "3.9"

services:
react_build:
build: .
working_dir: /app
volumes:
- ./build:/app/build
command: >
sh -c "npm install && npm run build"

nginx:
image: nginx:alpine
ports:
- "3000:80"
volumes:
- ./build:/usr/share/nginx/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- react_build

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
# ADD NGINX CONTENTS HERE
server {
listen 80;
server_name localhost;

root /usr/share/nginx/html;

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