-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b48ee38
commit 5ffe9bd
Showing
1 changed file
with
14 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |