summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorMavlushechka <mavlushechka@gmail.com>2022-09-24 00:07:19 +0500
committerMavlushechka <mavlushechka@gmail.com>2022-09-24 00:07:19 +0500
commit43ffc1d6e59f2d118c730e968e032fcecbeaf202 (patch)
tree7e1e87163c8af30cd29d2b6e745d1c6b1077dc25 /Dockerfile
parente7c380c64056a004a1d61f04df7afb2a1c1c3675 (diff)
Copy docker/getting-started repository
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile41
1 files changed, 41 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..4b43f6d
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,41 @@
+# Install the base requirements for the app.
+# This stage is to support development.
+FROM python:alpine AS base
+WORKDIR /app
+COPY requirements.txt .
+RUN pip install -r requirements.txt
+
+FROM node:12-alpine AS app-base
+WORKDIR /app
+COPY app/package.json app/yarn.lock ./
+COPY app/spec ./spec
+COPY app/src ./src
+
+# Run tests to validate app
+FROM app-base AS test
+RUN apk add --no-cache python3 g++ make
+RUN yarn install
+RUN yarn test
+
+# Clear out the node_modules and create the zip
+FROM app-base AS app-zip-creator
+COPY app/package.json app/yarn.lock ./
+COPY app/spec ./spec
+COPY app/src ./src
+RUN apk add zip && \
+ zip -r /app.zip /app
+
+# Dev-ready container - actual files will be mounted in
+FROM base AS dev
+CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
+
+# Do the actual build of the mkdocs site
+FROM base AS build
+COPY . .
+RUN mkdocs build
+
+# Extract the static content from the build
+# and use a nginx image to serve the content
+FROM nginx:alpine
+COPY --from=app-zip-creator /app.zip /usr/share/nginx/html/assets/app.zip
+COPY --from=build /app/site /usr/share/nginx/html