Subham9126 commited on
Commit
944ab45
Β·
verified Β·
1 Parent(s): 618a15b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -10
Dockerfile CHANGED
@@ -1,20 +1,48 @@
1
  FROM ubuntu:22.04
2
  ENV DEBIAN_FRONTEND=noninteractive
3
 
4
- # Redpanda
 
 
 
 
 
5
  RUN curl -1sLf 'https://dl.redpanda.com/nzc4ZYQK3WRGd9sy/redpanda/cfg/setup/bash.deb.sh' \
6
- | bash && apt-get install -y redpanda redpanda-console
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- # nginx + supervisor
9
- RUN apt-get install -y nginx supervisor gettext-base \
10
- && rm /etc/nginx/sites-enabled/default
 
 
 
 
 
11
 
12
- COPY nginx.conf /etc/nginx/nginx.conf
13
- COPY redpanda.yaml /etc/redpanda/redpanda.yaml
14
- COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
 
15
 
16
- RUN mkdir -p /var/lib/redpanda/data /var/log/supervisor \
17
- && chown -R redpanda:redpanda /var/lib/redpanda
 
 
 
18
 
 
19
  EXPOSE 7860
20
  CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
 
1
  FROM ubuntu:22.04
2
  ENV DEBIAN_FRONTEND=noninteractive
3
 
4
+ # ── 1. System deps ──────────────────────────────────────────────────────────
5
+ RUN apt-get update && apt-get install -y \
6
+ curl wget nginx supervisor ca-certificates \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # ── 2. Redpanda (broker + rpk + pandaproxy + schema-registry) ───────────────
10
  RUN curl -1sLf 'https://dl.redpanda.com/nzc4ZYQK3WRGd9sy/redpanda/cfg/setup/bash.deb.sh' \
11
+ | bash \
12
+ && apt-get install -y redpanda \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # ── 3. Redpanda Console binary (direct download β€” no apt needed) ─────────────
16
+ RUN CONSOLE_VER=2.7.2 && \
17
+ wget -qO /tmp/console.tar.gz \
18
+ "https://github.com/redpanda-data/console/releases/download/v${CONSOLE_VER}/redpanda-console_${CONSOLE_VER}_linux_amd64.tar.gz" \
19
+ && tar -xzf /tmp/console.tar.gz -C /usr/local/bin redpanda-console \
20
+ && chmod +x /usr/local/bin/redpanda-console \
21
+ && rm /tmp/console.tar.gz
22
+
23
+ # ── 4. Create user 1000 (matches HF Spaces runtime UID) ─────────────────────
24
+ RUN useradd -m -u 1000 -s /bin/bash rpuser
25
 
26
+ # ── 5. Directories β€” owned by uid 1000 ──────────────────────────────────────
27
+ RUN mkdir -p \
28
+ /home/rpuser/data \
29
+ /home/rpuser/logs \
30
+ /var/log/supervisor \
31
+ /run/nginx \
32
+ && chown -R 1000:1000 /home/rpuser \
33
+ && chmod -R 777 /var/log/supervisor /run/nginx
34
 
35
+ # ── 6. nginx β€” allow non-root ────────────────────────────────────────────────
36
+ RUN mkdir -p /var/lib/nginx/body /var/lib/nginx/proxy \
37
+ && chown -R 1000:1000 /var/lib/nginx /var/log/nginx \
38
+ && touch /run/nginx.pid && chown 1000:1000 /run/nginx.pid
39
 
40
+ # ── 7. Copy configs ──────────────────────────────────────────────────────────
41
+ COPY --chown=1000:1000 redpanda.yaml /home/rpuser/redpanda.yaml
42
+ COPY --chown=1000:1000 console.yaml /home/rpuser/console.yaml
43
+ COPY --chown=1000:1000 nginx.conf /etc/nginx/nginx.conf
44
+ COPY --chown=1000:1000 supervisord.conf /etc/supervisor/conf.d/supervisord.conf
45
 
46
+ USER 1000
47
  EXPOSE 7860
48
  CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]