FROM php:alpine
RUN apk update && apk add zip libxml2-dev libpng-dev && docker-php-ext-install mysqli simplexml mbstring gd
RUN \
mkdir /var/www && \
cd /var/www && mkdir mybb && cd mybb && \
curl https://resources.mybb.com/downloads/mybb_1815.zip -o mybb.zip && \
unzip mybb.zip "Upload/*" && \
mv Upload/* . && \
rm -Rf Upload mybb.zip && \
mv inc/config.default.php inc/config.php && \
chmod 666 inc/config.php inc/settings.php && \
chmod -R 777 inc/languages && \
chmod 777 cache/ cache/themes/ uploads/ uploads/avatars/ admin/backups/
WORKDIR /var/www
EXPOSE 80
CMD ["sh","-c","[ \"$(ls -A forum)\" ] && (echo \"Forum exist\" && php -S 0.0.0.0:80 -t forum) || (echo \"Forum does not exist, copying...\" && cp -R mybb/* forum && php -S 0.0.0.0:80 -t forum) "]
Feng
没有评论:
发表评论