Spaces:
Running
Running
Download Dockerfile from posit/quarto-template: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/posit/quarto-template/resolve/67b70d928f1992571aea95e64ac5aa5cca776c2b/Dockerfile
- Command line
-
hf download hf://spaces/posit/quarto-template@67b70d928f1992571aea95e64ac5aa5cca776c2b/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/posit/quarto-template/resolve/67b70d928f1992571aea95e64ac5aa5cca776c2b/Dockerfile
1.09 kB
| ARG QUARTO_VERSION="1.3.340" | |
| # Use the Quarto base image | |
| FROM ghcr.io/quarto-dev/quarto:${QUARTO_VERSION} AS builder | |
| COPY src /app | |
| WORKDIR /app | |
| # Install Python requirements | |
| USER root | |
| RUN apt-get update && apt-get install -y python3 python3-pip | |
| COPY requirements.txt /app/ | |
| RUN pip3 install -r requirements.txt | |
| # Use Quarto to render your site | |
| RUN quarto render . | |
| # Use httpd:alpine as the final image to serve the site | |
| FROM httpd:alpine | |
| # Create logs directory and ensure permissions (if you want to keep logs in files) | |
| RUN mkdir -p /usr/local/apache2/logs/ && chown -R www-data:www-data /usr/local/apache2/logs/ | |
| # Alternatively, link logs to stdout and stderr | |
| RUN ln -sf /dev/stdout /usr/local/apache2/logs/access.log \ | |
| && ln -sf /dev/stderr /usr/local/apache2/logs/error.log | |
| # Configure Apache to listen on port 8080 and set ServerName to suppress FQDN warning | |
| RUN sed -i 's/Listen 80/Listen 7860/' /usr/local/apache2/conf/httpd.conf \ | |
| && echo "ServerName localhost" >> /usr/local/apache2/conf/httpd.conf | |
| COPY --from=builder /app/_site/ /usr/local/apache2/htdocs/ | |
| EXPOSE 7860 |