Subham9126 commited on
Commit
8208b74
Β·
verified Β·
1 Parent(s): 944ab45

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -27
Dockerfile CHANGED
@@ -1,9 +1,11 @@
 
 
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) ───────────────
@@ -12,36 +14,35 @@ RUN curl -1sLf 'https://dl.redpanda.com/nzc4ZYQK3WRGd9sy/redpanda/cfg/setup/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
 
1
+ FROM docker.redpanda.com/redpandadata/console:latest AS console-src
2
+
3
  FROM ubuntu:22.04
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
  # ── 1. System deps ──────────────────────────────────────────────────────────
7
  RUN apt-get update && apt-get install -y \
8
+ curl nginx supervisor ca-certificates \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  # ── 2. Redpanda (broker + rpk + pandaproxy + schema-registry) ───────────────
 
14
  && apt-get install -y redpanda \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # ── 3. Console binary β€” pulled from official image, no wget needed ───────────
18
+ COPY --from=console-src /app/redpanda-console /usr/local/bin/redpanda-console
19
+ RUN chmod +x /usr/local/bin/redpanda-console
 
 
 
 
20
 
21
+ # ── 4. User matching HF Spaces runtime UID 1000 ──────────────────────────────
22
  RUN useradd -m -u 1000 -s /bin/bash rpuser
23
 
24
+ # ── 5. Directories ────────────────────────────────────────────────────────────
25
  RUN mkdir -p \
26
+ /home/rpuser/data \
27
+ /home/rpuser/logs \
28
+ /var/log/supervisor \
29
+ /run/nginx \
30
+ /var/lib/nginx/body \
31
+ /var/lib/nginx/proxy \
32
+ && chown -R 1000:1000 \
33
+ /home/rpuser \
34
+ /var/log/supervisor \
35
+ /var/log/nginx \
36
+ /var/lib/nginx \
37
+ /run/nginx \
38
+ && touch /run/nginx.pid \
39
+ && chown 1000:1000 /run/nginx.pid
40
+
41
+ # ── 6. Configs ────────────────────────────────────────────────────────────────
42
+ COPY --chown=1000:1000 redpanda.yaml /home/rpuser/redpanda.yaml
43
+ COPY --chown=1000:1000 console.yaml /home/rpuser/console.yaml
44
+ COPY --chown=1000:1000 nginx.conf /etc/nginx/nginx.conf
45
+ COPY --chown=1000:1000 supervisord.conf /etc/supervisor/conf.d/supervisord.conf
46
 
47
  USER 1000
48
  EXPOSE 7860