Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions remote-website-container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM alpine:latest

# Install required packages
RUN apk update && apk add \
vsftpd \
nginx \
php83 \
php83-fpm \
php83-opcache \
php83-json \
php83-mysqli \
php83-mbstring \
php83-session \
php83-zlib \
php83-curl \
php83-phar \
php83-dom \
php83-fileinfo \
php83-gd \
php83-zip \
php83-sqlite3 \
php83-openssl \
supervisor \
shadow \
openssl \
gettext # For envsubst

# Create shared group and configure users
RUN addgroup -g 1000 www_shared && \
mkdir -p /var/www/html && \
adduser -D -h /var/www/html -G www_shared -s /bin/false allsky && \
adduser nginx www_shared && \
chown allsky:www_shared /var/www/html && \
chmod 2775 /var/www/html

# Use configuration template
COPY vsftpd.conf.template /etc/vsftpd/
COPY entrypoint.sh /entrypoint.sh

# Configure other services
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervisord.conf /etc/supervisord.conf

# Copy Initial index.html
COPY index.html /var/www/html/index.html

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
35 changes: 35 additions & 0 deletions remote-website-container/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

# Set default values
export PASV_ADDRESS=${PASV_ADDRESS:-$(curl -s https://api.ipify.org)}
export PASV_MIN_PORT=${PASV_MIN_PORT:-40000}
export PASV_MAX_PORT=${PASV_MAX_PORT:-40010}

# Generate configuration from template
envsubst < /etc/vsftpd/vsftpd.conf.template > /etc/vsftpd/vsftpd.conf

# Set FTP password (for Docker testing)
if [ -n "$FTP_PASSWORD" ]; then
echo "allsky:$FTP_PASSWORD" | chpasswd
echo "Using provided FTP password"
else
echo "allsky:$(openssl rand -base64 12)" | chpasswd
fi

# Ensure default index.html exists if not provided by user
if [ ! -f /var/www/html/index.html ]; then
cat <<EOF > /var/www/html/index.html
<html>
<head>
<title>Allsky Remote Website is Available!</title>
</head>
<body>
<h1>Success! The Allsky Remote Website is Available!</h1>
<h2>Proceed with Remote Website Installation Script.</h2>
</body>
</html>
EOF
fi

# Start services
exec supervisord -c /etc/supervisord.conf
9 changes: 9 additions & 0 deletions remote-website-container/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>
<head>
<title>Allsky Remote Website is Available!</title>
</head>
<body>
<h1>Success! The Allsky Remote Website is Available!</h1>
<h2>Proceed with Remote Website Installation Script.</h2>
</body>
</html>
31 changes: 31 additions & 0 deletions remote-website-container/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
user nginx;
worker_processes auto;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

sendfile on;
keepalive_timeout 65;

server {
listen 80;
server_name localhost;
root /var/www/html;
index index.php index.html;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
}
3 changes: 3 additions & 0 deletions remote-website-container/notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker buildx build --no-cache --progress=plain -t czech12/allsky-remote-website:latest -t czech12/allsky-remote-website:allsky-web-ftp_v1.0 .

docker push czech12/allsky-remote-website -a
28 changes: 28 additions & 0 deletions remote-website-container/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[supervisord]
nodaemon=true
user=root

[program:php-fpm]
command=php-fpm83 -F
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:nginx]
command=nginx -g "daemon off;"
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:vsftpd]
command=vsftpd /etc/vsftpd/vsftpd.conf
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
exitcodes=0,2
18 changes: 18 additions & 0 deletions remote-website-container/vsftpd.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=002
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=NO
port_enable=NO
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_enable=YES
pasv_min_port=${PASV_MIN_PORT}
pasv_max_port=${PASV_MAX_PORT}
pasv_address=${PASV_ADDRESS}
pasv_promiscuous=YES
seccomp_sandbox=NO
25 changes: 25 additions & 0 deletions remote-website-container/vsftpd_.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=002
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/dev/stdout
connect_from_port_20=NO
port_enable=NO
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=40010
pasv_address=0.0.0.0
seccomp_sandbox=NO
background=NO
log_ftp_protocol=YES
require_ssl_reuse=NO
pasv_promiscuous=YES
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO