File size: 1,129 Bytes
327558c
269adcf
ee1303a
327558c
ee1303a
 
 
c527bbe
 
ee1303a
 
 
 
74e874b
ee1303a
 
1d8814b
632b7d6
ee1303a
aab59c9
 
1d8814b
1184f70
e4fb19e
327558c
1d8814b
43db0b4
1d8814b
b9b22dd
c539c03
327558c
 
80e3c68
 
327558c
aab59c9
c539c03
327558c
 
1d8814b
 
ee1303a
 
327558c
1a64e67
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
44
45
46
# Use an official Python runtime as the base image
FROM python:3.9-slim

# Install system dependencies, including Hugo and required libraries
RUN apt-get update && apt-get install -y \
    curl \
    git \
    build-essential \
    gcc \
    unzip \
    ca-certificates \
    libcurl4-openssl-dev \
    libssl-dev \
    hugo \
    && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

COPY ./app/themes/hugo-theme-stack /app/themes/hugo-theme-stack

# Copy the Hugo theme and all project files into the container
COPY . .

# Ensure Hugo has the right permissions
RUN chmod -R 777 /app

# Remove any stale Hugo build lock file
RUN rm -f /app/.hugo_build.lock

# Create a non-root user for security & set ownership
RUN useradd -m hugo && chown -R hugo:hugo /app
USER hugo

# Install Hugo modules if required
# RUN hugo mod clean && hugo mod get

# Build the Hugo site (no timestamps for consistency)
RUN hugo --noTimes

# Expose the port the Hugo server will use
EXPOSE 7860

# Start the Hugo server
CMD ["hugo", "server", "--bind", "0.0.0.0", "--port", "7860", "--disableFastRender", "--noBuildLock", "--noTimes"]