You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.5 KiB
39 lines
1.5 KiB
|
3 months ago
|
FROM php:8.1-fpm-alpine
|
||
|
|
|
||
|
|
# Install nginx
|
||
|
|
RUN apk add --no-cache nginx supervisor
|
||
|
|
|
||
|
|
# Copy site files
|
||
|
|
COPY index.html /var/www/html/
|
||
|
|
COPY styles.css /var/www/html/
|
||
|
|
COPY app.js /var/www/html/
|
||
|
|
COPY config.json /var/www/html/
|
||
|
|
COPY ticker-api.php /var/www/html/
|
||
|
|
COPY ticker-data.json /var/www/html/
|
||
|
|
|
||
|
|
# Copy favicon files
|
||
|
|
COPY favicon.ico /var/www/html/
|
||
|
|
COPY favicon.svg /var/www/html/
|
||
|
|
COPY favicon-16.png /var/www/html/
|
||
|
|
COPY favicon-32.png /var/www/html/
|
||
|
|
COPY apple-touch-icon.png /var/www/html/
|
||
|
|
|
||
|
|
# Copy nginx config
|
||
|
|
COPY nginx.conf /etc/nginx/http.d/default.conf
|
||
|
|
|
||
|
|
# Create basic robots.txt and sitemap.xml
|
||
|
|
RUN echo -e "User-agent: *\nAllow: /\n\nSitemap: /sitemap.xml" > /var/www/html/robots.txt && \
|
||
|
|
echo -e '<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n <url>\n <loc>https://your-domain.com/</loc>\n <lastmod>2025-10-06</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.8</priority>\n </url>\n</urlset>' > /var/www/html/sitemap.xml
|
||
|
|
|
||
|
|
# Set permissions
|
||
|
|
RUN chown -R www-data:www-data /var/www/html && \
|
||
|
|
chmod -R 644 /var/www/html/* && \
|
||
|
|
chmod 755 /var/www/html/ && \
|
||
|
|
chmod 666 /var/www/html/ticker-data.json
|
||
|
|
|
||
|
|
# Create supervisor config
|
||
|
|
RUN echo -e '[supervisord]\nnodaemon=true\n\n[program:php-fpm]\ncommand=php-fpm\nautostart=true\nautorestart=true\n\n[program:nginx]\ncommand=nginx -g "daemon off;"\nautostart=true\nautorestart=true' > /etc/supervisord.conf
|
||
|
|
|
||
|
|
EXPOSE 80
|
||
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|