Skip to content

Commit

Permalink
Add docker image for kubernetes helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
nuwang committed Dec 19, 2024
1 parent 3742d22 commit 3644482
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
57 changes: 57 additions & 0 deletions docker/kubernetes/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
FROM python:3.13-slim AS builder

ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive

#======================================================
# Builder - Create virtualenv for Pulsar
#======================================================
RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-transport-https \
# Install packages
&& apt-get update \
&& apt-get install -y --no-install-recommends gcc \
libcurl4-openssl-dev \
bzip2 virtualenv \
&& mkdir /pulsar

WORKDIR /pulsar

COPY pulsar_app-*-py2.py3-none-any.whl .
COPY requirements.txt .

# Install Pulsar Python requirements
RUN virtualenv .venv \
&& . .venv/bin/activate \
&& pip install wheel pykube-ng \
&& pip install -r requirements.txt Paste \
&& pip install `ls pulsar_app-*-py2.py3-none-any.whl`\[galaxy_extended_metadata,web,amqp\]

# generate default pulsar config
RUN .venv/bin/pulsar-config --host 0.0.0.0

#======================================================
# Final image - Copy virtualenv for Pulsar
#======================================================
FROM python:3.13-slim

ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
ENV PULSAR_CONFIG_PRIVATE_TOKEN=change_me

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
bzip2 virtualenv \
&& adduser --disabled-password --gecos '' pulsar \
&& mkdir /pulsar \
&& chown pulsar:pulsar /pulsar

WORKDIR /pulsar
COPY --chown=pulsar:pulsar --from=builder /pulsar .

USER pulsar

EXPOSE 8913

CMD [".venv/bin/pulsar"]
9 changes: 9 additions & 0 deletions docker/kubernetes/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


dist:
cd ../..; make dist; cp dist/pulsar*whl docker/kubernetes; cp requirements.txt docker/kubernetes

docker-image:
docker build -t 'galaxy/pulsar-kubernetes:0.15.7' .

all: dist docker-image

0 comments on commit 3644482

Please sign in to comment.