forked from dominant-strategies/quai-docusaurus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (22 loc) · 865 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Use an official Node.js runtime as the base image
FROM node:18-slim
# Set the working directory inside the container
WORKDIR /app
# Copy the package.json and package-lock.json to the container
COPY package*.json ./
# Install the dependencies in the container
RUN yarn install --frozen-lockfile
# Copy the rest of the application to the container
COPY . .
# Build the static site
RUN yarn build
# Use an Nginx image to serve the built static site
FROM nginx:alpine
# Copy the built static site from the build stage to the nginx html directory
COPY --from=0 /app/build/ /usr/share/nginx/html/docs
# Copy custom nginx configuration to set up routes
COPY ./nginx-custom-config.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start nginx with global directives and daemon off so it stays in the foreground
CMD ["nginx", "-g", "daemon off;"]