-
Notifications
You must be signed in to change notification settings - Fork 302
/
Dockerfile.slim
22 lines (14 loc) · 1.01 KB
/
Dockerfile.slim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -------------------Desciption---------------------
# FROM nginx:alpine-slim: Uses the alpine-slim nginx image as the base image.
# COPY nginx.conf /etc/nginx/conf.d/default.conf: Copies the nginx.conf file to the /etc/nginx/conf.d directory in the container, serving as the nginx configuration file.
# COPY dist /usr/share/nginx/html: Copies the contents of the dist directory to the /usr/share/nginx/html directory in the container, which serves as nginx's static file directory.
# EXPOSE 3000: Declares that the container is listening on port 3000.
# CMD ["nginx", "-g", "daemon off"]: Runs the nginx command with the parameters -g daemon off when the container starts, indicating nginx should start in the foreground.
# -------------------Usage--------------------
# $ docker build -f Dockerfile.slim -t picsmaller-slim .
# $ docker run -d -p 9000:3000 picsmaller-slim
FROM nginx:alpine-slim
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY dist /usr/share/nginx/html
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]