File size: 2,404 Bytes
8208b74
 
651f05a
 
 
944ab45
 
8208b74
944ab45
 
762d7e2
651f05a
944ab45
 
 
 
762d7e2
 
8208b74
944ab45
8208b74
944ab45
651f05a
8208b74
944ab45
8208b74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651f05a
944ab45
651f05a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM docker.redpanda.com/redpandadata/console:latest AS console-src

FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive

# ── 1. System deps ──────────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y \
    curl nginx supervisor ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# ── 2. Redpanda ──────────────────────────────────────────────────────────────
RUN curl -1sLf 'https://dl.redpanda.com/nzc4ZYQK3WRGd9sy/redpanda/cfg/setup/bash.deb.sh' \
    | bash \
    && apt-get install -y redpanda \
    && rm -rf /var/lib/apt/lists/*

# ── 3. Console binary β€” correct path is /app/console not /app/redpanda-console
COPY --from=console-src /app/console /usr/local/bin/redpanda-console
RUN chmod +x /usr/local/bin/redpanda-console

# ── 4. User matching HF Spaces runtime UID 1000 ──────────────────────────────
RUN useradd -m -u 1000 -s /bin/bash rpuser

# ── 5. Directories ────────────────────────────────────────────────────────────
RUN mkdir -p \
      /home/rpuser/data \
      /home/rpuser/logs \
      /var/log/supervisor \
      /run/nginx \
      /var/lib/nginx/body \
      /var/lib/nginx/proxy \
    && chown -R 1000:1000 \
      /home/rpuser \
      /var/log/supervisor \
      /var/log/nginx \
      /var/lib/nginx \
      /run/nginx \
    && touch /run/nginx.pid \
    && chown 1000:1000 /run/nginx.pid

# ── 6. Configs ────────────────────────────────────────────────────────────────
COPY --chown=1000:1000 redpanda.yaml     /home/rpuser/redpanda.yaml
COPY --chown=1000:1000 console.yaml      /home/rpuser/console.yaml
COPY --chown=1000:1000 nginx.conf        /etc/nginx/nginx.conf
COPY --chown=1000:1000 supervisord.conf  /etc/supervisor/conf.d/supervisord.conf

USER 1000
EXPOSE 7860
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]