wordpress funcionando mas o menos
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
66
Dockerfile
66
Dockerfile
@@ -1,5 +1,6 @@
|
||||
ARG UNIT_VERSION=1.10.0
|
||||
FROM eumau/nginx-unit:${UNIT_VERSION}-php7.3
|
||||
|
||||
# set recommended PHP.ini settings
|
||||
# see https://secure.php.net/manual/en/opcache.installation.php
|
||||
RUN { \
|
||||
@@ -25,6 +26,8 @@ RUN { \
|
||||
} > /etc/php/7.3/embed/conf.d/error-logging.ini
|
||||
|
||||
|
||||
VOLUME /var/www/html
|
||||
|
||||
ENV WORDPRESS_VERSION 5.2.3
|
||||
ENV WORDPRESS_SHA1 5efd37148788f3b14b295b2a9bf48a1a467aa303
|
||||
|
||||
@@ -34,34 +37,63 @@ RUN set -ex; \
|
||||
# upstream tarballs include ./wordpress/ so this gives us /usr/src/wordpress
|
||||
tar -xzf wordpress.tar.gz -C /usr/src/; \
|
||||
rm wordpress.tar.gz; \
|
||||
chown -R www-data:www-data /usr/src/wordpress
|
||||
chown -R www-data:www-data /usr/src/wordpress; \
|
||||
chown -R www-data:www-data /var/www/html
|
||||
|
||||
# port used by the listener in config.json
|
||||
EXPOSE 8080
|
||||
EXPOSE 8090 8091
|
||||
|
||||
# application setup
|
||||
RUN mkdir -p /var/www/html && echo '<?php echo phpinfo(); ' > /var/www/html/index.php && chown -R www-data:www-data /var/www/html
|
||||
VOLUME /var/www/html
|
||||
|
||||
# launch Unit
|
||||
RUN unitd --control unix:/var/run/control.unit.sock \
|
||||
# upload the app config to Unit
|
||||
&& curl -X PUT --data-binary '{ \
|
||||
RUN \
|
||||
[ -f /var/www/html/index.php ] || { \
|
||||
touch /var/www/html/index.php /var/www/html/index.php.remove; \
|
||||
} \
|
||||
&& unitd --control unix:/var/run/control.unit.sock \
|
||||
# upload the app config to Unit
|
||||
&& curl -X PUT --data-binary '{ \
|
||||
"listeners": { \
|
||||
"*:8080": { \
|
||||
"pass": "applications/wordpress" \
|
||||
"*:8090": { \
|
||||
"application": "script_index_php" \
|
||||
}, \
|
||||
"*:8091": { \
|
||||
"application": "direct_php" \
|
||||
} \
|
||||
}, \
|
||||
"applications": { \
|
||||
"wordpress": { \
|
||||
"script_index_php": { \
|
||||
"type": "php", \
|
||||
"user": "www-data", \
|
||||
"group": "www-data", \
|
||||
"root": "/var/www/html" \
|
||||
"processes": { \
|
||||
"max": 20, \
|
||||
"spare": 5 \
|
||||
}, \
|
||||
"user": "www-data", \
|
||||
"group": "www-data", \
|
||||
"root": "/var/www/html", \
|
||||
"script": "index.php" \
|
||||
}, \
|
||||
"direct_php": { \
|
||||
"type": "php", \
|
||||
"processes": { \
|
||||
"max": 5, \
|
||||
"spare": 0 \
|
||||
}, \
|
||||
"user": "www-data", \
|
||||
"group": "www-data", \
|
||||
"root": "/var/www/html", \
|
||||
"script": "index.php" \
|
||||
} \
|
||||
} \
|
||||
}' --unix-socket /var/run/control.unit.sock http://localhost/config/
|
||||
}' --unix-socket /var/run/control.unit.sock http://localhost/config/ \
|
||||
&& [ -f /var/www/html/index.php.remove ] && { \
|
||||
rm /var/www/html/index.php /var/www/html/index.php.remove; \
|
||||
}
|
||||
|
||||
VOLUME /www
|
||||
# COPY docker-entrypoint.sh /usr/local/bin/
|
||||
# ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
|
||||
Reference in New Issue
Block a user