Skip to content

Commit d88e770

Browse files
committed
Docker files
1 parent 7b8fbbe commit d88e770

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

docker/Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#From PHP8.3-cli
2+
FROM php:8.3-cli-alpine
3+
4+
RUN adduser -h /home/admin -s /home/admin/vendor/bin/phpterminal -D admin
5+
RUN echo -n 'admin:admin' | chpasswd
6+
7+
WORKDIR /home/admin
8+
9+
RUN apk update
10+
RUN apk add --update --no-cache git
11+
RUN apk add --update --no-cache zip
12+
13+
RUN docker-php-ext-configure pcntl --enable-pcntl && docker-php-ext-install pcntl
14+
15+
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
16+
RUN php composer-setup.php
17+
RUN php -r "unlink('composer-setup.php');"
18+
RUN mv composer.phar /home/admin/composer
19+
RUN chmod +x /home/admin/composer
20+
RUN /home/admin/composer require oyeaussie/phpfirewall
21+
ENV COMPOSER_ALLOW_SUPERUSER=1
22+
23+
RUN mkdir /home/admin/terminaldata
24+
25+
RUN apk add --update --no-cache openssh
26+
RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
27+
RUN echo 'Port 2233' >> /etc/ssh/sshd_config
28+
ENTRYPOINT ["/entrypoint.sh"]
29+
COPY entrypoint.sh /
30+
RUN chown -R admin:admin /home/admin/
31+
32+
# Running
33+
# docker run -d --name phpfirewall -h phpfirewall oyeaussie/phpfirewall
34+
# Grab IP
35+
# docker exec phpfirewall cat /etc/hosts | grep phpfirewall
36+
# {container IP} phpfirewall
37+
# Connect via ssh
38+
# ssh -l admin -p 2233 {container IP}

docker/entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
ssh-keygen -A
3+
exec /usr/sbin/sshd -D -e "$@"

0 commit comments

Comments
 (0)