AnthropicallyHuggingFaces commited on
Commit
c4dc6f0
·
verified ·
1 Parent(s): 6923d87

Add Dockerfile building nginx from source on port 7860

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ LISTEN_PORT=7860 \
5
+ UPSTREAM_URL=http://127.0.0.1:5000/
6
+
7
+ # Build toolchain + gettext-base (envsubst) + python3 for the demo upstream.
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev \
10
+ libssl-dev wget curl ca-certificates gettext-base python3 procps \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Build nginx from source using the spec'd installer. In a container there is
14
+ # no systemd, so the unit file is written but never started; the entrypoint
15
+ # runs nginx in the foreground instead. LISTEN_PORT=7860 matches app_port.
16
+ COPY install-nginx.sh /opt/install-nginx.sh
17
+ RUN chmod +x /opt/install-nginx.sh \
18
+ && LISTEN_PORT=7860 UPSTREAM_URL=http://127.0.0.1:5000/ /opt/install-nginx.sh
19
+
20
+ COPY demo_upstream.py /opt/demo_upstream.py
21
+ COPY docker-entrypoint.sh /opt/docker-entrypoint.sh
22
+ RUN chmod +x /opt/docker-entrypoint.sh
23
+
24
+ EXPOSE 7860
25
+
26
+ CMD ["/opt/docker-entrypoint.sh"]