AstraOS commited on
Commit
c527bbe
·
verified ·
1 Parent(s): 6eeaae9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -11
Dockerfile CHANGED
@@ -1,25 +1,34 @@
1
  # Use an official Python runtime as the base image for Hugging Face and other dependencies
2
  FROM python:3.9-slim
3
 
4
- # Set environment variables for Hugging Face, Hugo and the working directory
5
  ENV LANG C.UTF-8
6
- ENV HUGO_VERSION 0.112.5
 
7
 
8
- # Install system dependencies, including Hugo and others needed for Hugging Face
9
  RUN apt-get update && apt-get install -y \
10
  curl \
11
  git \
 
 
12
  unzip \
13
  ca-certificates \
14
  libcurl4-openssl-dev \
15
  libssl-dev \
16
- build-essential \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- # Install Hugo
20
- RUN curl -sSL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb -o hugo.deb \
21
- && dpkg -i hugo.deb \
22
- && rm hugo.deb
 
 
 
 
 
 
 
23
 
24
  # Install Python dependencies for Hugging Face
25
  RUN pip install --no-cache-dir \
@@ -35,11 +44,11 @@ WORKDIR /app
35
  # Copy the Hugo site files into the container
36
  COPY ./content/post /app/content/post
37
 
38
- # Build the Hugo site (you can change this if needed based on your Hugo site structure)
39
  RUN cd /app/content/post && hugo
40
 
41
- # Expose the port the server will run on (adjust as needed for your setup)
42
  EXPOSE 7860
43
 
44
  # Define the command to run both the Hugging Face API server and the Hugo site
45
- CMD ["sh", "-c", "cd /app/content/post && hugo server --bind 0.0.0.0 & uvicorn app:app --host 0.0.0.0 --port 7860"]
 
1
  # Use an official Python runtime as the base image for Hugging Face and other dependencies
2
  FROM python:3.9-slim
3
 
4
+ # Set environment variables
5
  ENV LANG C.UTF-8
6
+ ENV GO_VERSION 1.23.0
7
+ ENV HUGO_VERSION latest
8
 
9
+ # Install system dependencies, including Go, GCC, and others needed for Hugo
10
  RUN apt-get update && apt-get install -y \
11
  curl \
12
  git \
13
+ build-essential \
14
+ gcc \
15
  unzip \
16
  ca-certificates \
17
  libcurl4-openssl-dev \
18
  libssl-dev \
 
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
+ # Install Go
22
+ RUN curl -sSL https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz -o go${GO_VERSION}.tar.gz \
23
+ && tar -xvzf go${GO_VERSION}.tar.gz \
24
+ && mv go /usr/local/ \
25
+ && rm go${GO_VERSION}.tar.gz
26
+
27
+ # Set Go binary path
28
+ ENV PATH="/usr/local/go/bin:${PATH}"
29
+
30
+ # Install Hugo from source (Standard edition)
31
+ RUN go install github.com/gohugoio/hugo@${HUGO_VERSION}
32
 
33
  # Install Python dependencies for Hugging Face
34
  RUN pip install --no-cache-dir \
 
44
  # Copy the Hugo site files into the container
45
  COPY ./content/post /app/content/post
46
 
47
+ # Build the Hugo site
48
  RUN cd /app/content/post && hugo
49
 
50
+ # Expose the port the server will run on
51
  EXPOSE 7860
52
 
53
  # Define the command to run both the Hugging Face API server and the Hugo site
54
+ CMD ["sh", "-c", "cd /app/content/post && hugo server --bind 0.0.0.0 & uvicorn app:app --host 0.0.0.0 --port 7860"]