-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (26 loc) · 807 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
33
34
35
36
37
# Use the official Node.js base image
FROM node:latest
# Install Jemalloc
RUN apt-get update && apt-get install libjemalloc-dev -y && apt-get clean
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so"
# Create APP directory
WORKDIR /usr/src/app
# Install app dependencies
COPY package*.json ./
RUN npm install
# Bundle app source
COPY . .
# Build React app
RUN npm run build
# Use the official Nginx base image
FROM nginx:latest
# Remove the default Nginx configuration
RUN rm /etc/nginx/conf.d/default.conf
# Copy the Nginx configuration file
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy the built React app from the Node.js image
COPY --from=0 /usr/src/app/dist /usr/share/nginx/html
# Expose port 80 (default for HTTP)
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]