Skip to content

Commit

Permalink
update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
yeranosyanvahan committed Nov 18, 2023
1 parent b48ee38 commit 5ffe9bd
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit 5ffe9bd

Please sign in to comment.