-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
43 lines (30 loc) · 921 Bytes
/
Dockerfile.prod
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
38
39
40
41
42
43
# Stage 1: Build Stage
FROM golang:alpine AS build
# Set the working directory within the container
WORKDIR /app
# Copy your Hugo project files
COPY . .
# Install Hugo
RUN apk add --no-cache hugo
# Install Node.js and npm (npm includes npx)
RUN apk add --no-cache nodejs npm
# Install PostCSS
RUN npm install -g postcss-cli
# Generate your website's static content
RUN hugo
# Stage 2: Web Server Stage
FROM nginx:alpine
# Set NGINX's default serving directory
WORKDIR /usr/share/nginx/html
# Copy the generated static website from the build stage
COPY --from=build /app/public /usr/share/nginx/html
# Optional: Copy your custom Nginx configuration if needed
# COPY nginx.conf /etc/nginx/nginx.conf
# Expose the port NGINX uses
EXPOSE 8080
# Command to start NGINX when the container runs
CMD ["nginx", "-g", "daemon off;"]
#env var
ENV NODE_ENV=production \
HOSTNAME="0.0.0.0" \
NEXT_TELEMETRY_DISABLED=1