diff --git a/runtimes/8.0/Dockerfile b/runtimes/8.0/Dockerfile index 23fb2ace..3afbbe57 100644 --- a/runtimes/8.0/Dockerfile +++ b/runtimes/8.0/Dockerfile @@ -12,6 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive ENV TZ=UTC ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" ENV SUPERVISOR_PHP_USER="sail" +ENV SUPERVISOR_SSH_COMMAND="/usr/sbin/sshd -D" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -60,6 +61,14 @@ RUN userdel -r ubuntu RUN groupadd --force -g $WWWGROUP sail RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail +RUN apt-get update && apt-get upgrade -y \ + && apt-get install -y openssh-server \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN mkdir /var/run/sshd +RUN sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config + COPY start-container /usr/local/bin/start-container COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY php.ini /etc/php/8.0/cli/conf.d/99-sail.ini diff --git a/runtimes/8.0/start-container b/runtimes/8.0/start-container index 40c55dfe..8fbe2ea8 100644 --- a/runtimes/8.0/start-container +++ b/runtimes/8.0/start-container @@ -9,6 +9,10 @@ if [ ! -z "$WWWUSER" ]; then usermod -u $WWWUSER sail fi +if [ ! -z "$SSH_PASSWORD" ]; then + echo "sail:$SSH_PASSWORD" | chpasswd +fi + if [ ! -d /.composer ]; then mkdir /.composer fi diff --git a/runtimes/8.0/supervisord.conf b/runtimes/8.0/supervisord.conf index 656da8a9..f81f18fe 100644 --- a/runtimes/8.0/supervisord.conf +++ b/runtimes/8.0/supervisord.conf @@ -12,3 +12,12 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 + +[program:ssh] +command=%(ENV_SUPERVISOR_SSH_COMMAND)s +user=root +environment=LARAVEL_SAIL="1" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/runtimes/8.1/Dockerfile b/runtimes/8.1/Dockerfile index 2261ab86..8342d706 100644 --- a/runtimes/8.1/Dockerfile +++ b/runtimes/8.1/Dockerfile @@ -12,6 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive ENV TZ=UTC ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" ENV SUPERVISOR_PHP_USER="sail" +ENV SUPERVISOR_SSH_COMMAND="/usr/sbin/sshd -D" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -59,6 +60,14 @@ RUN userdel -r ubuntu RUN groupadd --force -g $WWWGROUP sail RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail +RUN apt-get update && apt-get upgrade -y \ + && apt-get install -y openssh-server \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN mkdir /var/run/sshd +RUN sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config + COPY start-container /usr/local/bin/start-container COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY php.ini /etc/php/8.1/cli/conf.d/99-sail.ini diff --git a/runtimes/8.1/start-container b/runtimes/8.1/start-container index 40c55dfe..8fbe2ea8 100644 --- a/runtimes/8.1/start-container +++ b/runtimes/8.1/start-container @@ -9,6 +9,10 @@ if [ ! -z "$WWWUSER" ]; then usermod -u $WWWUSER sail fi +if [ ! -z "$SSH_PASSWORD" ]; then + echo "sail:$SSH_PASSWORD" | chpasswd +fi + if [ ! -d /.composer ]; then mkdir /.composer fi diff --git a/runtimes/8.1/supervisord.conf b/runtimes/8.1/supervisord.conf index 656da8a9..f81f18fe 100644 --- a/runtimes/8.1/supervisord.conf +++ b/runtimes/8.1/supervisord.conf @@ -12,3 +12,12 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 + +[program:ssh] +command=%(ENV_SUPERVISOR_SSH_COMMAND)s +user=root +environment=LARAVEL_SAIL="1" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/runtimes/8.2/Dockerfile b/runtimes/8.2/Dockerfile index 88d497ab..3cc8bfa2 100644 --- a/runtimes/8.2/Dockerfile +++ b/runtimes/8.2/Dockerfile @@ -12,6 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive ENV TZ=UTC ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" ENV SUPERVISOR_PHP_USER="sail" +ENV SUPERVISOR_SSH_COMMAND="/usr/sbin/sshd -D" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -60,6 +61,14 @@ RUN userdel -r ubuntu RUN groupadd --force -g $WWWGROUP sail RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail +RUN apt-get update && apt-get upgrade -y \ + && apt-get install -y openssh-server \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN mkdir /var/run/sshd +RUN sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config + COPY start-container /usr/local/bin/start-container COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY php.ini /etc/php/8.2/cli/conf.d/99-sail.ini diff --git a/runtimes/8.2/start-container b/runtimes/8.2/start-container index 40c55dfe..8fbe2ea8 100644 --- a/runtimes/8.2/start-container +++ b/runtimes/8.2/start-container @@ -9,6 +9,10 @@ if [ ! -z "$WWWUSER" ]; then usermod -u $WWWUSER sail fi +if [ ! -z "$SSH_PASSWORD" ]; then + echo "sail:$SSH_PASSWORD" | chpasswd +fi + if [ ! -d /.composer ]; then mkdir /.composer fi diff --git a/runtimes/8.2/supervisord.conf b/runtimes/8.2/supervisord.conf index 656da8a9..f81f18fe 100644 --- a/runtimes/8.2/supervisord.conf +++ b/runtimes/8.2/supervisord.conf @@ -12,3 +12,12 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 + +[program:ssh] +command=%(ENV_SUPERVISOR_SSH_COMMAND)s +user=root +environment=LARAVEL_SAIL="1" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/runtimes/8.3/Dockerfile b/runtimes/8.3/Dockerfile index af5cb8e7..b9fad561 100644 --- a/runtimes/8.3/Dockerfile +++ b/runtimes/8.3/Dockerfile @@ -13,6 +13,7 @@ ENV DEBIAN_FRONTEND=noninteractive ENV TZ=UTC ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" ENV SUPERVISOR_PHP_USER="sail" +ENV SUPERVISOR_SSH_COMMAND="/usr/sbin/sshd -D" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -61,6 +62,14 @@ RUN userdel -r ubuntu RUN groupadd --force -g $WWWGROUP sail RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail +RUN apt-get update && apt-get upgrade -y \ + && apt-get install -y openssh-server \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN mkdir /var/run/sshd +RUN sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config + COPY start-container /usr/local/bin/start-container COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY php.ini /etc/php/8.3/cli/conf.d/99-sail.ini diff --git a/runtimes/8.3/start-container b/runtimes/8.3/start-container index 40c55dfe..8fbe2ea8 100644 --- a/runtimes/8.3/start-container +++ b/runtimes/8.3/start-container @@ -9,6 +9,10 @@ if [ ! -z "$WWWUSER" ]; then usermod -u $WWWUSER sail fi +if [ ! -z "$SSH_PASSWORD" ]; then + echo "sail:$SSH_PASSWORD" | chpasswd +fi + if [ ! -d /.composer ]; then mkdir /.composer fi diff --git a/runtimes/8.3/supervisord.conf b/runtimes/8.3/supervisord.conf index 656da8a9..f81f18fe 100644 --- a/runtimes/8.3/supervisord.conf +++ b/runtimes/8.3/supervisord.conf @@ -12,3 +12,12 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 + +[program:ssh] +command=%(ENV_SUPERVISOR_SSH_COMMAND)s +user=root +environment=LARAVEL_SAIL="1" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/runtimes/8.4/Dockerfile b/runtimes/8.4/Dockerfile index 8707873e..ab9dcbdb 100644 --- a/runtimes/8.4/Dockerfile +++ b/runtimes/8.4/Dockerfile @@ -13,6 +13,7 @@ ENV DEBIAN_FRONTEND=noninteractive ENV TZ=UTC ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" ENV SUPERVISOR_PHP_USER="sail" +ENV SUPERVISOR_SSH_COMMAND="/usr/sbin/sshd -D" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -62,6 +63,14 @@ RUN userdel -r ubuntu RUN groupadd --force -g $WWWGROUP sail RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail +RUN apt-get update && apt-get upgrade -y \ + && apt-get install -y openssh-server \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN mkdir /var/run/sshd +RUN sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config + COPY start-container /usr/local/bin/start-container COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY php.ini /etc/php/8.4/cli/conf.d/99-sail.ini diff --git a/runtimes/8.4/start-container b/runtimes/8.4/start-container index 40c55dfe..8fbe2ea8 100644 --- a/runtimes/8.4/start-container +++ b/runtimes/8.4/start-container @@ -9,6 +9,10 @@ if [ ! -z "$WWWUSER" ]; then usermod -u $WWWUSER sail fi +if [ ! -z "$SSH_PASSWORD" ]; then + echo "sail:$SSH_PASSWORD" | chpasswd +fi + if [ ! -d /.composer ]; then mkdir /.composer fi diff --git a/runtimes/8.4/supervisord.conf b/runtimes/8.4/supervisord.conf index 656da8a9..f81f18fe 100644 --- a/runtimes/8.4/supervisord.conf +++ b/runtimes/8.4/supervisord.conf @@ -12,3 +12,12 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 + +[program:ssh] +command=%(ENV_SUPERVISOR_SSH_COMMAND)s +user=root +environment=LARAVEL_SAIL="1" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/stubs/docker-compose.stub b/stubs/docker-compose.stub index c574efcb..eee7c78f 100644 --- a/stubs/docker-compose.stub +++ b/stubs/docker-compose.stub @@ -10,9 +10,11 @@ services: extra_hosts: - 'host.docker.internal:host-gateway' ports: + # - '${SSH_PORT:-2222}:22' - '${APP_PORT:-80}:80' - '${VITE_PORT:-5173}:${VITE_PORT:-5173}' environment: + # SSH_PASSWORD: WWWUSER: '${WWWUSER}' LARAVEL_SAIL: 1 XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'