Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile to build from source #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions docker/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Build From Source
FROM node:11-alpine
RUN apk update && apk add git
RUN git clone https://github.com/lensesio/schema-registry-ui
WORKDIR /schema-registry-ui
RUN npm install && npm run build-prod

# Build Image
FROM alpine
WORKDIR /

# Add needed tools
RUN apk add --no-cache ca-certificates wget && \
echo "progress = dot:giga" | tee /etc/wgetrc

# Add and Setup Caddy webserver
ENV CADDY_VERSION="0.10.11"
RUN wget "https://github.com/mholt/caddy/releases/download/v${CADDY_VERSION}/caddy_v${CADDY_VERSION}_linux_amd64.tar.gz" -O /caddy.tgz && \
mkdir caddy && \
tar xzf caddy.tgz -C /caddy --no-same-owner && \
rm -f /caddy.tgz

# Add Schema-Registry-UI, configurations, and runtime files
COPY --from=0 /schema-registry-ui/dist/ /schema-registry-ui
RUN rm -f /schema-registry-ui/env.js && ln -s /tmp/env.js /schema-registry-ui/env.js
COPY --from=0 /schema-registry-ui/docker/Caddyfile /caddy/Caddyfile.template
COPY --from=0 /schema-registry-ui/docker/run.sh /
RUN chmod +x /run.sh

EXPOSE 8000

# USER nobody:nogroup
ENTRYPOINT ["/run.sh"]