From 6b9cef02a1a84b2d02671fd4c596d4fd1cd54b19 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 18 Aug 2022 16:55:48 +0300 Subject: [PATCH] Use better defaults for pageserver Docker image --- Dockerfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 17aa0025e8..dccf7b6c54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,8 @@ +### Creates a storage Docker image with postgres, pageserver, safekeeper and proxy binaries. +### The image itself is mainly used as a container for the binaries and for starting e2e tests with custom parameters. +### By default, the binaries inside the image have some mock parameters and can start, but are not intended to be used +### inside this image in the real deployments. + # Build Postgres FROM 369495373322.dkr.ecr.eu-central-1.amazonaws.com/rust:pinned AS pg-build WORKDIR /home/nonroot @@ -58,7 +63,18 @@ COPY --from=build --chown=zenith:zenith /home/nonroot/target/release/proxy COPY --from=pg-build /home/nonroot/tmp_install/ /usr/local/ COPY --from=pg-build /home/nonroot/postgres_install.tar.gz /data/ +# By default, pageserver uses `.neon/` working directory in WORKDIR, so create one and fill it with the dummy config. +# Now, when `docker run ... pageserver` is run, it can start without errors, yet will have some default dummy values. +RUN mkdir -p /data/.neon/ && chown -R zenith:zenith /data/.neon/ \ + && /usr/local/bin/pageserver -D /data/.neon/ --init \ + -c "id=1234" \ + -c "broker_endpoints=['http://etcd:2379']" \ + -c "pg_distrib_dir='/usr/local'" \ + -c "listen_pg_addr='0.0.0.0:6400'" \ + -c "listen_http_addr='0.0.0.0:9898'" + VOLUME ["/data"] USER zenith EXPOSE 6400 -CMD ["pageserver"] +EXPOSE 9898 +CMD ["/bin/bash"]