Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 5f7f6ca

Browse files
author
Sameer Naik
committed
use multistage docker builds
1 parent 71950b3 commit 5f7f6ca

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Top level files and directories
2+
/.circleci/
3+
/.git/
4+
/.dockerignore
5+
/.gcloudignore
6+
/cloudbuild.yaml
7+
/site
8+
/Dockerfile

.gcloudignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!include:.dockerignore
2+
!Dockerfile

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
FROM nginx
1+
FROM python:3 AS builder
2+
3+
RUN pip install mkdocs
4+
5+
COPY . /docs
26

3-
ADD site/ /usr/share/nginx/html/
7+
RUN mkdocs build --clean --config-file /docs/mkdocs.yml
8+
9+
FROM nginx
410

11+
COPY --from=builder /docs/site/ /usr/share/nginx/html/

cloudbuild.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
steps:
2-
- name: 'gcr.io/triggermesh/mkdocs:latest'
3-
args: ['mkdocs', 'build']
4-
- name: 'debian'
5-
args: ['ls', '/workspace/site']
62
- name: 'gcr.io/cloud-builders/docker'
73
args: ['build', '-t', 'gcr.io/$PROJECT_ID/www:$REVISION_ID', '-t', 'gcr.io/$PROJECT_ID/www:latest', '.']
84
- name: 'gcr.io/cloud-builders/docker'

0 commit comments

Comments
 (0)