diff --git a/application-code/web-tier/Dockerfile b/application-code/web-tier/Dockerfile new file mode 100644 index 0000000..72f5970 --- /dev/null +++ b/application-code/web-tier/Dockerfile @@ -0,0 +1,23 @@ +# Stage 1: Build the React app +FROM node:18 AS builder + +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +# Stage 2: Serve with NGINX +FROM nginx:stable-alpine + +# Remove default config + +# copy our custom config + +# copy build output to NGINX web root +COPY --from=builder /app/build /usr/share/nginx/html + +# Expose port +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"]