From 5ffe9bd9740f355c5ea68f7a61e7c9211c091ffe Mon Sep 17 00:00:00 2001 From: Vahan Yeranosyan Date: Sat, 18 Nov 2023 11:07:23 +0400 Subject: [PATCH] update dockerfile --- Dockerfile | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6617664..ba0f829 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,18 @@ -# Build stage -FROM node:21 as build-stage +FROM node:16.4 as react WORKDIR /app -COPY package*.json ./ -RUN npm install -COPY . . +ADD ./package*.json ./ +RUN npm install -y +COPY ./ ./ RUN npm run build -# Production stage -FROM nginx:alpine as production-stage -COPY --from=build-stage /app/public /usr/share/nginx/html +FROM httpd:2.4 EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] + +RUN sed -i \ + -e 's/ServerAdmin you@example.com/ServerAdmin admin@yeranosyanvahan.com/g' \ + -e 's/ServerName www.example.com:80/ServerName www.yeranosyanvahan.com/g' \ + conf/httpd.conf + +RUN echo "ErrorDocument 404 /index.html" >> conf/httpd.conf + +COPY --from=react /app/build /usr/local/apache2/htdocs/ \ No newline at end of file