AstraOS commited on
Commit
ee1303a
·
verified ·
1 Parent(s): d1418ea

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -0
Dockerfile ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 \
26
+ transformers \
27
+ torch \
28
+ huggingface_hub \
29
+ fastapi \
30
+ uvicorn
31
+
32
+ # Create a working directory for the Hugo site and the Hugging Face models
33
+ WORKDIR /app
34
+
35
+ # Copy the Hugo site files into the container
36
+ COPY ./hugo-site /app/hugo-site
37
+
38
+ # Build the Hugo site (you can change this if needed based on your Hugo site structure)
39
+ RUN cd /app/hugo-site && 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/hugo-site && hugo server --bind 0.0.0.0 & uvicorn app:app --host 0.0.0.0 --port 7860"]