Files
2026-07-13 12:31:00 +08:00

22 lines
1.0 KiB
Docker

# -------------------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;"]