···11+# Dockerfile
22+33+# Step 1: Use a Node.js image to build the app
44+FROM node:18 as builder
55+66+# Set working directory inside the container
77+WORKDIR /app
88+99+# Copy package.json and package-lock.json
1010+COPY ./mast-react-vite/package*.json ./
1111+1212+# Install dependencies
1313+RUN npm install
1414+1515+# Copy the rest of the app’s source code
1616+COPY ./mast-react-vite/ .
1717+1818+# Build the app
1919+RUN npm run build
2020+2121+2222+# Step 2: Use an Nginx image to serve the static files
2323+FROM nginx:alpine
2424+2525+# Copy the build files from the builder stage to the Nginx web directory
2626+COPY --from=builder /app/dist /usr/share/nginx/html
2727+2828+# Expose port 80
2929+EXPOSE 80
3030+3131+# Start Nginx server
3232+CMD ["nginx", "-g", "daemon off;"]
+3-4
fly.toml
···11-# fly.toml app configuration file generated for mast-react-vite-cold-snowflake-8783 on 2025-02-19T23:28:02-08:00
11+# fly.toml app configuration file generated for mast on 2025-02-23T00:18:31-08:00
22#
33# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
44#
5566-app = 'mast-react-vite'
66+app = 'mast'
77primary_region = 'sea'
8899[build]
1010- image = 'react-server:latest'
11101211[http_service]
1313- internal_port = 8080
1212+ internal_port = 80
1413 force_https = true
1514 auto_stop_machines = true
1615 auto_start_machines = true