File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ # Step 1: Build the React application
2+ FROM node:20 AS build
3+ ENV BACKEND_API_URL = "https://backendtest-dcavk67s4a-uc.a.run.app"
4+ WORKDIR /app
5+ COPY package.json yarn.lock ./
6+ RUN yarn install
7+ COPY . ./
8+ RUN yarn run build
9+
10+ # Step 2: Serve the application using Nginx
11+ FROM nginx:alpine
12+ COPY --from=build /app/dist /usr/share/nginx/html
13+ COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
14+
15+ EXPOSE 8080
16+ CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change 1+ server {
2+
3+ listen 8080 ;
4+
5+ location / {
6+ root /usr/share/nginx/html;
7+ index index .html index .htm;
8+ try_files $uri $uri / /index .html;
9+ }
10+
11+ error_page 401 403 404 index .html;
12+
13+ location /public {
14+ root /usr/local/var/www;
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments