Skip to content

Commit

Permalink
Merge pull request #27 from Jaydee94/dockerfile-refactor
Browse files Browse the repository at this point in the history
Refactor Dockerfiles
  • Loading branch information
Jaydee94 authored Oct 12, 2020
2 parents a08866b + 066ffaf commit 487f303
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile-API
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM abihf/wget:latest AS kubeseal-downloader
RUN wget https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.11.0/kubeseal-linux-amd64 && \
mv kubeseal-linux-amd64 /tmp/kubeseal

FROM python:3.8-alpine3.12

ENV PORT 5000
ENV HOST 0.0.0.0

RUN mkdir /kubeseal-webgui
COPY --from=kubeseal-downloader /tmp/kubeseal /kubeseal-webgui

COPY api/ /kubeseal-webgui/
RUN chown -R 1001:1001 /kubeseal-webgui && \
chmod +x /kubeseal-webgui/kubeseal

WORKDIR /kubeseal-webgui
RUN pip install -r requirements.txt

USER 1001

RUN pytest -m "not cluster"

CMD [ "sh", "-c", "flask run --port $PORT --host $HOST" ]
9 changes: 9 additions & 0 deletions Dockerfile-UI
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:lts-alpine AS ui-build-stage
COPY ui/ /ui
WORKDIR /ui
RUN npm install && npm run build

FROM nginx:stable-alpine as ui-production-stage
COPY --from=ui-build-stage /ui/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 487f303

Please sign in to comment.