From dbe81d19edb98f3ad14db7b3848f0cd52cf1cdc3 Mon Sep 17 00:00:00 2001 From: Scott Cathcart Date: Thu, 17 Oct 2024 14:55:13 -0400 Subject: [PATCH] add dockerfile --- Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9a91737 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# Step 1: Build the React application +FROM node:14 AS build +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +# Step 2: Serve the app using NGINX +FROM nginx:stable-alpine +RUN chmod -R g+rwx /var/cache/nginx /var/run /var/log/nginx +RUN chown -R nginx:0 /usr/share/nginx/html && \ + chmod -R g+rwX /usr/share/nginx/html +COPY --from=build /app/dist /usr/share/nginx/html +EXPOSE 8080 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file