chore: Update Dockerfile to remove unnecessary SSH server configuration
This commit is contained in:
@@ -44,6 +44,9 @@ RUN npm install -g pm2
|
|||||||
# Create a directory for the SSH keys
|
# Create a directory for the SSH keys
|
||||||
RUN mkdir -p /root/.ssh
|
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 the entrypoint script into the container
|
||||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
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
|
# Check if the required environment variables are set
|
||||||
if [ -z "$REPO_URL" ]; then
|
if [ -z "$REPO_URL" ]; then
|
||||||
echo "Error: REPO_URL environment variable must be set."
|
echo "Error: REPO_URL environment variable must be set."
|
||||||
@@ -16,6 +13,20 @@ if [ ! -f /root/.ssh/id_rsa ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
# Ensure the SSH key has the correct permissions
|
||||||
chmod 600 /root/.ssh/id_rsa
|
chmod 600 /root/.ssh/id_rsa
|
||||||
|
|
||||||
@@ -50,6 +61,14 @@ if [ -f /environment/.env ]; then
|
|||||||
cp /environment/.env /workspace/.env
|
cp /environment/.env /workspace/.env
|
||||||
fi
|
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
|
# Start the cron service
|
||||||
service cron start
|
service cron start
|
||||||
nohup teleport start &
|
nohup teleport start &
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ RUN npm install -g pm2
|
|||||||
RUN apt-get update && apt-get install -y git openssh-client software-properties-common sudo
|
RUN apt-get update && apt-get install -y git openssh-client software-properties-common sudo
|
||||||
# RUN apt-get install -y fish
|
# RUN apt-get install -y fish
|
||||||
|
|
||||||
|
RUN git clone https://gitea.bramkelchtermans.be/Bram/linux-presets.git && cd linux-presets && chmod +x setup.sh && ./setup.sh --terminal-icon
|
||||||
|
RUN rm -rf linux-presets
|
||||||
|
|
||||||
RUN usermod -aG sudo root
|
RUN usermod -aG sudo root
|
||||||
|
|
||||||
# SHELL [ "fish", "--command" ]
|
# SHELL [ "fish", "--command" ]
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
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
|
# Check if the required environment variables are set
|
||||||
if [ -z "$REPO_URL" ]; then
|
if [ -z "$REPO_URL" ]; then
|
||||||
echo "Error: REPO_URL environment variable must be set."
|
echo "Error: REPO_URL environment variable must be set."
|
||||||
@@ -16,6 +13,18 @@ if [ ! -f /root/.ssh/id_rsa ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Ensure the SSH key has the correct permissions
|
# Ensure the SSH key has the correct permissions
|
||||||
chmod 600 /root/.ssh/id_rsa
|
chmod 600 /root/.ssh/id_rsa
|
||||||
|
|
||||||
@@ -53,6 +62,18 @@ else
|
|||||||
echo "Error: Environment file not found at /environment/.dev.env"
|
echo "Error: Environment file not found at /environment/.dev.env"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
# Set the git user and email
|
||||||
|
git config --global user.name $GIT_USER
|
||||||
|
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"
|
||||||
|
|
||||||
nohup teleport start &
|
nohup teleport start &
|
||||||
# Start the application with pm2
|
# Start the application with pm2
|
||||||
|
|||||||
Reference in New Issue
Block a user