-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 687 Bytes
/
Dockerfile
File metadata and controls
34 lines (23 loc) · 687 Bytes
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
# Uses Node.js 12
FROM node as build
# Changes the directory to /app
WORKDIR /app
# Copy the files, except for the ones specefied in .dockerignore
COPY . .
# Installs all dependencies
RUN npm install --loglevel=error
# Production build
RUN npm run build
###
# Creates the nginx server
FROM nginx:alpine
# Copies the build directory to Nginx image
COPY --from=build /app/build /var/www/html/build/
# Removes the default configuration
RUN rm -f /etc/nginx/nginx.conf
# Copies my configuration to the image
COPY nginx.conf /etc/nginx/nginx.conf
# Exposes port 80
EXPOSE 80
# Tells the nginx to work in the background. Best practice for docker
CMD ["nginx", "-g", "daemon off;"]