forked from tutorialworks/linux-website-vagrant
-
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
6dc0b22
commit f642a1a
Showing
1 changed file
with
8 additions
and
24 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,27 +1,11 @@ | ||
FROM node:16-alpine as development | ||
# Use an official Nginx runtime as a parent image | ||
FROM nginx | ||
|
||
WORKDIR /app | ||
# Copy your HTML site into the Nginx web server directory | ||
COPY ./page /usr/share/nginx/html | ||
|
||
COPY package.json ./ | ||
COPY npm-shrinkwrap.json ./ | ||
COPY .npmrc ./ | ||
# Expose the Nginx port to the host | ||
EXPOSE 80 | ||
|
||
RUN npm install --global npm@latest | ||
RUN npm ci | ||
|
||
COPY .*.js ./ | ||
COPY *config.?js ./ | ||
COPY vite.config.ts ./ | ||
COPY index.html ./ | ||
COPY public ./public | ||
COPY src ./src | ||
|
||
CMD [ "npm", "start"] | ||
|
||
FROM development as builder | ||
|
||
RUN npm run build | ||
|
||
FROM nginx:1.21-alpine as production | ||
|
||
COPY --from=builder /app/build /usr/share/nginx/html | ||
# Start Nginx when the container launches | ||
CMD ["nginx", "-g", "daemon off;"] |