chore: temp selfhosted migration + flv module refactors

This commit is contained in:
2025-11-10 21:40:56 +01:00
parent fb40d87736
commit 3a89f07a6f
5 changed files with 33 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
FROM alpine:3.19 as builder
FROM alpine:3.19 AS builder
RUN apk add --no-cache \
build-base \
@@ -37,20 +37,8 @@ RUN mkdir -p /etc/nginx/templates
EXPOSE 80 1935 8888
# Create an entrypoint script to handle environment variable substitution
RUN echo '#!/bin/sh \n\
# Replace environment variables in configuration templates \n\
for template in /etc/nginx/templates/*.conf.template; do \n\
if [ -f "$template" ]; then \n\
output_file="/usr/local/nginx/conf/$(basename $template .template)" \n\
echo "Processing template: $template -> $output_file" \n\
envsubst "$(env | awk -F= "{printf \\\"\\\$%s \\\",\\\$1}")" < $template > $output_file \n\
fi \n\
done \n\
\n\
# Start Nginx \n\
exec "$@"' > /docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]

View File

@@ -0,0 +1,27 @@
#!/bin/sh
set -e
UID=${UID:-1000}
GID=${GID:-1000}
echo "Setting UID to $UID and GID to $GID"
usermod -u $UID nginx 2>/dev/null || echo "Failed to change UID"
groupmod -g $GID nginx 2>/dev/null || echo "Failed to change GID"
mkdir -p /usr/local/nginx/conf
for template in /etc/nginx/templates/*.conf.template; do
if [ -f "$template" ]; then
output_file="/usr/local/nginx/conf/$(basename $template .template)"
echo "Processing template: $template -> $output_file"
envsubst '${API_AUTH}' < $template > $output_file
fi
done
mkdir -p /usr/local/nginx/proxy_temp /usr/local/nginx/client_body_temp
mkdir -p /var/www/html
chown -R nginx:nginx /usr/local/nginx /var/www/html
echo "Testing nginx configuration..."
/usr/local/nginx/sbin/nginx -t
exec "$@"