From 7a0a5929107adf93d2659fe7c4f9a7804dfeee02 Mon Sep 17 00:00:00 2001 From: smuu <18609909+smuu@users.noreply.github.com> Date: Tue, 26 Mar 2024 03:09:53 +0100 Subject: [PATCH] feat: add workdir to dockerfile (#3186) ## Overview This should be a non-breaking change. This only changes the work directory when the container is started. This means that if you want to execute a command in a running container, it will be automatically in that directory instead of '/'. This improves maintaining and debugging our environments. ## Checklist - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords --------- Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com> --- Dockerfile | 2 ++ docker/Dockerfile_txsim | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index ace443ecfb..defec1a4f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,6 +57,8 @@ COPY --from=builder /celestia-app/build/celestia-appd /bin/celestia-appd COPY --chown=${USER_NAME}:${USER_NAME} docker/entrypoint.sh /opt/entrypoint.sh # Set the user to celestia. USER ${USER_NAME} +# Set the working directory to the home directory. +WORKDIR ${CELESTIA_HOME} # Expose ports: # 1317 is the default API server port. # 9090 is the default GRPC server port. diff --git a/docker/Dockerfile_txsim b/docker/Dockerfile_txsim index dc9f32dd3a..767853f6ae 100644 --- a/docker/Dockerfile_txsim +++ b/docker/Dockerfile_txsim @@ -53,6 +53,9 @@ COPY --chown=${USER_NAME}:${USER_NAME} docker/txsim.sh /opt/entrypoint.sh USER ${USER_NAME} +# Set the working directory to the home directory. +WORKDIR ${CELESTIA_HOME} + # grpc, rpc, api ports EXPOSE 26657 1317 9090