|
| 1 | +# NOTE: you must `export UID` before building |
| 2 | + |
1 | 3 | services: |
2 | | - live: |
| 4 | + build: |
3 | 5 | build: |
4 | | - context: docker |
5 | | - dockerfile: Dockerfile |
6 | | - ports: |
7 | | - - 4000:4000 |
8 | | - command: bazel run //site:live |
9 | | - volumes: |
| 6 | + context: &context https://github.com/envoyproxy/toolshed.git#f89fb5df8defa4b7daf9a19a899dbdfbbf3b8d62:docker/bazel |
| 7 | + args: |
| 8 | + USER_NAME: "${USER}" |
| 9 | + USER_ID: &uid "${UID}" |
| 10 | + GROUP_ID: &gid "${GID:-}" |
| 11 | + APT_PKGS: &apt_pkgs >- |
| 12 | + autoconf |
| 13 | + automake |
| 14 | + bison |
| 15 | + build-essential |
| 16 | + gawk |
| 17 | + git |
| 18 | + gnupg2 |
| 19 | + libffi-dev |
| 20 | + libgdbm-dev |
| 21 | + libgmp-dev |
| 22 | + libncurses5-dev |
| 23 | + libreadline-dev |
| 24 | + libsqlite3-dev |
| 25 | + libssl-dev |
| 26 | + libtool |
| 27 | + libyaml-dev |
| 28 | + pkg-config |
| 29 | + sqlite3 |
| 30 | + zlib1g-dev |
| 31 | + command: ./build-website.sh |
| 32 | + user: ${UID:-1000}:${GID:-} |
| 33 | + volumes: &volumes |
10 | 34 | - .:/src/workspace/envoy-website |
11 | | - - ~/.cache/bazel:/$HOME/.cache/bazel |
12 | | - - ~/.cache/bazelisk:/$HOME/.cache/bazelisk |
| 35 | + - ~/.cache/bazel:$HOME/.cache/bazel |
| 36 | + - ~/.cache/bazelisk:$HOME/.cache/bazelisk |
13 | 37 | working_dir: /src/workspace/envoy-website |
14 | 38 | environment: |
15 | | - LOCAL_UID: ${UID:?"`UID` must be set, try `export UID`"} |
16 | | - LOCAL_USER_NAME: $USERNAME |
17 | | - LOCAL_USER_HOME: $HOME |
| 39 | + BAZEL_BUILD_OPTIONS: &bazel_options ${BAZEL_BUILD_OPTIONS:-} |
18 | 40 |
|
19 | | - live_docs: |
| 41 | + live: |
20 | 42 | build: |
21 | | - context: docker |
22 | | - dockerfile: Dockerfile |
23 | | - ports: |
24 | | - - 4000:4000 |
25 | | - command: | |
26 | | - bash -c '\ |
27 | | - bazel run --action_env=ENVOY_COMMIT="$$(bazel run //docs:latest_version)" \ |
28 | | - //site:live_docs' |
29 | | - volumes: |
30 | | - - .:/src/workspace/envoy-website |
31 | | - - ~/.cache/bazel:/$HOME/.cache/bazel |
32 | | - - ~/.cache/bazelisk:/$HOME/.cache/bazelisk |
| 43 | + context: *context |
| 44 | + target: extra |
| 45 | + args: |
| 46 | + USER_NAME: ${USER} |
| 47 | + USER_ID: *uid |
| 48 | + GROUP_ID: *gid |
| 49 | + APT_PKGS: *apt_pkgs |
| 50 | + EXTRA_APT_PKGS: >- |
| 51 | + inotify-tools |
| 52 | + command: ./rebuild.sh |
| 53 | + user: ${UID:?"`UID` must be set, try `export UID`"}:${GID:-} |
| 54 | + volumes: *volumes |
33 | 55 | working_dir: /src/workspace/envoy-website |
34 | 56 | environment: |
35 | | - LOCAL_UID: ${UID:?"`UID` must be set, try `export UID`"} |
36 | | - LOCAL_USER_NAME: $USERNAME |
37 | | - LOCAL_USER_HOME: $HOME |
| 57 | + BAZEL_BUILD_OPTIONS: *bazel_options |
| 58 | + DEBUG: ${DEBUG:-} |
| 59 | + RUN_ON_START: ${RUN_ON_START:-1} |
| 60 | + WATCH_COMMAND: inotify |
38 | 61 |
|
39 | | - build: |
40 | | - build: |
41 | | - context: docker |
42 | | - dockerfile: Dockerfile |
43 | | - command: ./build-website.sh |
| 62 | + website: |
| 63 | + image: nginx |
| 64 | + depends_on: |
| 65 | + - ${BUILDER:-build} |
| 66 | + command: |
| 67 | + - /bin/sh |
| 68 | + - -c |
| 69 | + - | |
| 70 | + cat <<EOF > /etc/nginx/conf.d/default.conf |
| 71 | + server { |
| 72 | + listen 8000; |
| 73 | + listen [::]:8000; |
| 74 | + server_name localhost; |
| 75 | + location / { |
| 76 | + root /usr/share/nginx/html; |
| 77 | + index index.html index.htm; |
| 78 | + } |
| 79 | + } |
| 80 | + EOF |
| 81 | + nginx -g 'daemon off;' |
44 | 82 | volumes: |
45 | | - - .:/src/workspace/envoy-website |
46 | | - - ~/.cache/bazel:/$HOME/.cache/bazel |
47 | | - - ~/.cache/bazelisk:/$HOME/.cache/bazelisk |
48 | | - working_dir: /src/workspace/envoy-website |
49 | | - environment: |
50 | | - BAZEL_BUILD_OPTIONS: $BAZEL_BUILD_OPTIONS |
51 | | - LOCAL_UID: ${UID:?"`UID` must be set, try `export UID`"} |
52 | | - LOCAL_USER_NAME: $USERNAME |
53 | | - LOCAL_USER_HOME: $HOME |
| 83 | + - ./_site:/usr/share/nginx/html:z |
| 84 | + ports: |
| 85 | + - 8000:8000 |
54 | 86 |
|
55 | 87 | update: |
56 | 88 | build: |
57 | 89 | context: docker |
58 | 90 | dockerfile: Dockerfile |
| 91 | + args: |
| 92 | + USER_NAME: "${USERNAME}" |
| 93 | + USER_ID: "${UID}" |
| 94 | + GROUP_ID: "${GID:-}" |
59 | 95 | command: ./sync_envoy.sh |
| 96 | + user: "${UID:-1000}:${GID:-1000}" |
60 | 97 | volumes: |
61 | 98 | - .:/src/workspace/envoy-website |
62 | 99 | - ${ENVOY_SRC_DIR:-../envoy}:/src/workspace/envoy |
63 | 100 | - ~/.cache/bazel:/$HOME/.cache/bazel |
64 | 101 | - ~/.cache/bazelisk:/$HOME/.cache/bazelisk |
65 | 102 | working_dir: /src/workspace/envoy-website |
66 | 103 | environment: |
67 | | - LOCAL_UID: ${UID:?"`UID` must be set, try `export UID`"} |
68 | | - LOCAL_USER_NAME: $USERNAME |
69 | | - LOCAL_USER_HOME: $HOME |
70 | 104 | ENVOY_SRC_DIR: ../envoy |
71 | | - COMMITTER_NAME: ${COMMITTER_NAME} |
72 | | - COMMITTER_EMAIL: ${COMMITTER_EMAIL} |
73 | | - |
74 | | - static: |
75 | | - image: nginx |
76 | | - volumes: |
77 | | - - ./_site:/usr/share/nginx/html:z |
78 | | - ports: |
79 | | - - 7000:80 |
| 105 | + COMMITTER_NAME: ${COMMITTER_NAME:-} |
| 106 | + COMMITTER_EMAIL: ${COMMITTER_EMAIL:-} |
0 commit comments