gobalkrishnan commited on
Commit
2d618da
·
1 Parent(s): a0df48a
Files changed (1) hide show
  1. Dockerfile +25 -7
Dockerfile CHANGED
@@ -1,20 +1,38 @@
 
 
1
  ARG QUARTO_VERSION="1.4.550"
2
 
3
  # Use the Quarto base image
4
  FROM ghcr.io/quarto-dev/quarto:${QUARTO_VERSION} AS builder
5
 
6
- COPY src /app
7
  WORKDIR /app
8
 
9
- # Install Python requirements
10
- USER root
11
- RUN apt-get update && apt-get install -y python3 python3-pip
 
 
 
 
 
12
  COPY requirements.txt /app/
13
- RUN pip3 install -r requirements.txt
14
 
 
15
  RUN quarto render .
16
 
 
 
 
 
 
 
 
 
 
 
17
  EXPOSE 7860
18
- CMD ["python3", "-m", "http.server", "7860", "--directory", "_site"]
19
 
20
- #Test1
 
 
1
+
2
+
3
  ARG QUARTO_VERSION="1.4.550"
4
 
5
  # Use the Quarto base image
6
  FROM ghcr.io/quarto-dev/quarto:${QUARTO_VERSION} AS builder
7
 
8
+ # Set working directory
9
  WORKDIR /app
10
 
11
+ # Copy application source
12
+ COPY src /app
13
+
14
+ # Install Python and dependencies
15
+ RUN apt-get update && apt-get install -y --fix-missing python3 python3-pip \
16
+ && apt-get clean \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
  COPY requirements.txt /app/
20
+ RUN pip3 install --no-cache-dir -r requirements.txt
21
 
22
+ # Render the Quarto project
23
  RUN quarto render .
24
 
25
+ # Final stage
26
+ FROM python:3.9-slim
27
+
28
+ # Set working directory
29
+ WORKDIR /app
30
+
31
+ # Copy the rendered site from the builder stage
32
+ COPY --from=builder /app/_site /app/_site
33
+
34
+ # Expose the port
35
  EXPOSE 7860
 
36
 
37
+ # Run the HTTP server
38
+ CMD ["python3", "-m", "http.server", "7860", "--directory", "_site"]