FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive \ LISTEN_PORT=7860 \ UPSTREAM_URL=http://127.0.0.1:5000/ # Build toolchain + gettext-base (envsubst) + python3 for the demo upstream. RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev \ libssl-dev wget curl ca-certificates gettext-base python3 procps \ && rm -rf /var/lib/apt/lists/* # Build nginx from source using the spec'd installer. In a container there is # no systemd, so the unit file is written but never started; the entrypoint # runs nginx in the foreground instead. LISTEN_PORT=7860 matches app_port. COPY install-nginx.sh /opt/install-nginx.sh RUN chmod +x /opt/install-nginx.sh \ && LISTEN_PORT=7860 UPSTREAM_URL=http://127.0.0.1:5000/ /opt/install-nginx.sh COPY demo_upstream.py /opt/demo_upstream.py COPY docker-entrypoint.sh /opt/docker-entrypoint.sh RUN chmod +x /opt/docker-entrypoint.sh EXPOSE 7860 CMD ["/opt/docker-entrypoint.sh"]