OOps here are the files

This commit is contained in:
Jake Runyan 2024-12-27 13:31:41 -10:00
parent f7657648b6
commit 9c86bffcd2
2 changed files with 49 additions and 0 deletions

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
# Use the official Node.js image as a build stage
FROM node:14 AS build
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the React application
RUN npm run build
# Use a lightweight web server to serve the build files
FROM nginx:alpine
# Copy the build files from the previous stage
COPY --from=build /app/build /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]

20
docker-compose.yml Normal file
View File

@ -0,0 +1,20 @@
version: '2.4'
networks:
traefik:
external: true
services:
image: jakesphotos:latest
portfolio:
build:
context: .
dockerfile: Dockerfile
networks:
- traefik
labels:
- traefik.http.routers.photography.rule=Host(`jakesphotos.whitney.rip`)
- traefik.http.routers.photography.tls=true
- traefik.http.routers.photography.tls.certresolver=lets-encrypt
- traefik.http.services.photography.loadbalancer.server.port=80
- traefik.port=80