From f7753156452b4aa8dc32d7c446ebcab811516b1f Mon Sep 17 00:00:00 2001 From: Bram Kelchtermans Date: Mon, 19 Aug 2024 16:55:32 +0200 Subject: [PATCH] chore: Update Dockerfile to fix Teleport installation command and create teleport configuration file --- Dockers/remote-react-container/entrypoint.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockers/remote-react-container/entrypoint.sh b/Dockers/remote-react-container/entrypoint.sh index 4c8c2f7..52ad9cf 100644 --- a/Dockers/remote-react-container/entrypoint.sh +++ b/Dockers/remote-react-container/entrypoint.sh @@ -80,17 +80,19 @@ git config --global user.email $GIT_EMAIL # Get the hostname of the machine HOSTNAME=$(hostname) -# # File path -# CONFIG_FILE="/etc/teleport.yaml" - -# # Edit the teleport.yaml file to update the nodename -# sed -i "s/^ nodename:.*/ nodename: $HOSTNAME/" "$CONFIG_FILE" - ## If teleport token is set, join the server if [ -n "$TELEPORT_TOKEN" ]; then + rm -rf /etc/teleport.yaml teleport configure --roles=node --token=$TELEPORT_TOKEN --proxy=$TELEPORT_URL --no-acme -o file + echo "Created teleport configuration file" fi +# File path +CONFIG_FILE="/etc/teleport.yaml" + +# Edit the teleport.yaml file to update the nodename +sed -i "s/^ nodename:.*/ nodename: $HOSTNAME/" "$CONFIG_FILE" + nohup teleport start & # Start the application with pm2 exec pm2-runtime "yarn start:dev"