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
18 changes: 17 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# ADD DOCKERFILE CONTENTS HERE
# Building the react app
FROM node:22-alpine as build
WORKDIR /app

# Installing dependencies first
COPY package.json package-lock.json .
RUN npm ci

# Copy the rest of the app
COPY . .
RUN npm run build

# Production
FROM nginx:alpine as prod
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# ADD DOCKER-COMPOSE CONTENTS HERE
services:
web:
build:
context: .
target: prod
ports:
- "8080:80"
11 changes: 10 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
# ADD NGINX CONTENTS HERE
server {
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
listen 80;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}