# NOTE: you must `export UID` before building x-envoy-build: &envoy-build working_dir: /src/workspace/envoy-website volumes: &envoy-build-volumes - .:/src/workspace/envoy-website - ~/.cache/bazel:/home/envoybuild/.cache/bazel - ~/.cache/bazelisk:/home/envoybuild/.cache/bazelisk environment: &envoy-build-env USER_UID: ${UID:?"`UID` must be set, try `export UID`"} USER_GID: ${GID:-} GITHUB_TOKEN: ${GITHUB_TOKEN:-} HOME: /home/envoybuild BAZEL_BUILD_OPTIONS: ${BAZEL_BUILD_OPTIONS:-} entrypoint: ["/bin/bash", "-c"] command: - | if [[ -n "$${USER_GID}" ]]; then groupmod -g "$${USER_GID}" envoybuild >/dev/null fi usermod -u "$${USER_UID}" envoybuild >/dev/null chown envoybuild /proc/self/fd/2 2>/dev/null || true exec gosu envoybuild "$${DOCKER_COMMAND}" services: build: <<: *envoy-build build: context: docker target: build environment: <<: *envoy-build-env DOCKER_COMMAND: ./build-website.sh live: <<: *envoy-build build: context: docker target: live environment: <<: *envoy-build-env DOCKER_COMMAND: ./rebuild.sh DEBUG: ${DEBUG:-} RUN_ON_START: ${RUN_ON_START:-1} WATCH_COMMAND: inotify website: build: context: docker dockerfile: Dockerfile.website depends_on: - ${BUILDER:-build} command: - /bin/sh - -c - | cat < /etc/nginx/conf.d/default.conf server { listen 8000; listen [::]:8000; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } } EOF nginx -g 'daemon off;' volumes: - ./_site:/usr/share/nginx/html:z ports: - 8000:8000