chore: Update Dockerfile to remove unnecessary SSH server configuration

This commit is contained in:
2024-07-08 22:02:56 +02:00
parent 282d6b27f6
commit 8622a71053
4 changed files with 52 additions and 6 deletions
+3
View File
@@ -44,6 +44,9 @@ RUN npm install -g pm2
# Create a directory for the SSH keys
RUN mkdir -p /root/.ssh
RUN git clone https://gitea.bramkelchtermans.be/Bram/linux-presets.git && cd linux-presets && chmod +x setup.sh && ./setup.sh --terminal-icon 
RUN rm -r linux-presets/
# Copy the entrypoint script into the container
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
+22 -3
View File
@@ -1,9 +1,6 @@
#!/bin/bash
set -e
git clone https://gitea.bramkelchtermans.be/Bram/linux-presets.git && cd linux-presets && chmod +x setup.sh && ./setup.sh --terminal-icon 
rm -r linux-presets/
# Check if the required environment variables are set
if [ -z "$REPO_URL" ]; then
echo "Error: REPO_URL environment variable must be set."
@@ -16,6 +13,20 @@ if [ ! -f /root/.ssh/id_rsa ]; then
exit 1
fi
if [ -z $GIT_USER ]; then
echo "Error: GIT_USER environment variable must be set."
exit 1
fi
if [ -z $GIT_EMAIL ]; then
echo "Error: GIT_EMAIL environment variable must be set."
exit 1
fi
# Set the git user and email
git config --global user.name $GIT_USER
git config --global user.email $GIT_EMAIL
# Ensure the SSH key has the correct permissions
chmod 600 /root/.ssh/id_rsa
@@ -50,6 +61,14 @@ if [ -f /environment/.env ]; then
cp /environment/.env /workspace/.env
fi
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"
# Start the cron service
service cron start
nohup teleport start &