diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..191fcb2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +# Build Stage +FROM node:latest as build-stage + +WORKDIR /app + +# Copy package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application files to the working directory +COPY . . + +# Build the React application +RUN npm run build + +# Production Stage +FROM nginx:latest + +# Copy the NGINX configuration file +COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf + +# Copy the build artifacts from the build stage to NGINX web server +COPY --from=build-stage /app/build/ /usr/share/nginx/html + +# We need to make sure not to run the container as a non root user +# for better security +WORKDIR /app +RUN chown -R nginx:nginx /app && chmod -R 755 /app && \ + chown -R nginx:nginx /var/cache/nginx && \ + chown -R nginx:nginx /var/log/nginx && \ + chown -R nginx:nginx /etc/nginx/conf.d +RUN touch /var/run/nginx.pid && \ + chown -R nginx:nginx /var/run/nginx.pid + +USER nginx + +# Expose port 80 for the NGINX server +EXPOSE 80 + +# Command to start NGINX when the container is run +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..60aa534 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,19 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html; + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + location /health { + return 200; + } +} \ No newline at end of file diff --git a/public/logo192.png b/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/public/logo192.png and /dev/null differ diff --git a/public/logo512.png b/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/public/logo512.png and /dev/null differ