diff --git a/Dockerfile b/Dockerfile index 310d389..a825c59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM nvcr.io/nvidia/pytorch:23.10-py3 +# FROM nvcr.io/nvidia/pytorch:23.10-py3 +FROM ubuntu:20.04 RUN apt update && apt install software-properties-common -y RUN add-apt-repository ppa:deadsnakes/ppa -y @@ -13,6 +14,12 @@ RUN poetry env use /usr/bin/python3.11 RUN poetry install RUN poetry run playwright install firefox && poetry run playwright install-deps -COPY . /app +RUN apt install -y trafficserver +COPY trafficserver_config/*.config /etc/trafficserver/ +COPY trafficserver_config/ssl /etc/trafficserver/ssl +RUN chown -R trafficserver:trafficserver /etc/trafficserver +COPY trafficserver_config/ssl/canva.com.crt /usr/local/share/ca-certificates/canva.com.crt +RUN update-ca-certificates +COPY dns_records.sh . -CMD /bin/sh +CMD su - root -c "sh /app/dns_records.sh" && /etc/init.d/trafficserver start && /bin/bash diff --git a/dns_records.sh b/dns_records.sh new file mode 100644 index 0000000..48499d2 --- /dev/null +++ b/dns_records.sh @@ -0,0 +1,2 @@ +echo "127.0.0.1 font-public.canva.com +127.0.0.1 media-public.canva.com" >> /etc/hosts diff --git a/trafficserver_config/cache.config b/trafficserver_config/cache.config new file mode 100644 index 0000000..a5d7e0a --- /dev/null +++ b/trafficserver_config/cache.config @@ -0,0 +1,57 @@ +# +# cache.config +# +# Documentation: +# https://docs.trafficserver.apache.org/en/latest/admin-guide/files/cache.config.en.html +# +# The purpose of this file is to alter caching parameters of +# specific objects or sets of objects +# +# Each line consists of a set of tag value pairs. The pairs +# are in the format = +# +# Each line must include exactly one primary specifier +# +# Primary destination specifiers are +# dest_domain= +# dest_host= +# dest_ip= +# url_regex= +# +# +# Lines may include any number of the secondary specifiers but +# secondary specifiers may not be duplicated on the same line +# +# Secondary specifiers are +# port= +# scheme= +# prefix= +# suffix= +# method= +# time= +# src_ip= +# internal={true,false} +# +# Each line must include exactly one cache directive +# Cache directives are +# action=never-cache +# action=ignore-no-cache (client & server no cache) +# action=ignore-client-no-cache (only client no cache) +# action=ignore-server-no-cache (only server no cache) +# pin-in-cache=