File size: 1,805 Bytes
ee1303a
 
 
c527bbe
ee1303a
c527bbe
 
ee1303a
c527bbe
ee1303a
 
 
c527bbe
 
ee1303a
 
 
 
74e874b
ee1303a
 
c527bbe
6cb9eb8
 
 
 
c527bbe
 
6cb9eb8
c527bbe
 
6cb9eb8
ee1303a
 
 
6cb9eb8
 
ee1303a
 
 
 
1184f70
632b7d6
ee1303a
1184f70
 
 
 
ee1303a
1184f70
 
e2e24e2
1184f70
1edc5ab
1184f70
 
e4fb19e
c539c03
 
 
 
c527bbe
495dc10
ee1303a
c539c03
c527bbe
ee1303a
 
495dc10
 
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Use an official Python runtime as the base image for Hugging Face and other dependencies
FROM python:3.9-slim

# Set environment variables
ENV LANG C.UTF-8
ENV GO_VERSION 1.23.0
ENV HUGO_VERSION latest

# Install system dependencies, including Go, GCC, and others needed for Hugo
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/*

# Install Go
# RUN curl -sSL https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz -o go${GO_VERSION}.tar.gz \
#     && tar -xvzf go${GO_VERSION}.tar.gz \
#     && mv go /usr/local/ \
#     && rm go${GO_VERSION}.tar.gz

# Set Go binary path
# ENV PATH="/usr/local/go/bin:${PATH}"

# Install Hugo from source (Standard edition)
# RUN go install github.com/gohugoio/hugo@${HUGO_VERSION}

# Install Python dependencies for Hugging Face
RUN pip install --no-cache-dir \
    # transformers \
    # torch \
    huggingface_hub \
    fastapi \
    uvicorn

# # Create a working directory for the Hugo site and the Hugging Face models
WORKDIR /app

# COPY ./content /app/content
# COPY ./config /app/config
# COPY ./static /app/static
# COPY ./assets /app/assets

# # Ensure Hugo Modules are fetched (this is important for theme dependencies)
# # RUN hugo mod get

# # Copy the theme into the /themes directory
COPY ./app/themes/hugo-theme-stack /app/themes/hugo-theme-stack

COPY . .

RUN hugo --ignoreCache \
    && hugo mod clean \
    && hugo mod get

# Build the Hugo site
RUN hugo


# Expose the port the server will run on
EXPOSE 7860

# Define the command to run both the Hugo site and the Hugging Face API
CMD ["sh", "-c", "hugo server --bind 0.0.0.0 & uvicorn app:app --host 0.0.0.0 --port 7860"]