diff --git a/devops/Dockerfile b/devops/Dockerfile index 5f70b64..fa68548 100644 --- a/devops/Dockerfile +++ b/devops/Dockerfile @@ -9,13 +9,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr/include \ && docker-php-ext-install gd -# Install composer -RUN curl -sS https://getcomposer.org/installer | php -- \ - --filename=composer \ - --install-dir=/usr/local/bin && \ - echo "alias composer='composer'" >> /root/.bashrc && \ - composer - # php configs COPY www.conf /usr/local/etc/php-fpm.d/www.conf COPY docker-php.ini /usr/local/etc/php/conf.d/docker-php.ini @@ -25,6 +18,14 @@ RUN apt-get install -y nginx # nginx configs COPY nginx /etc/nginx +# source code +COPY htdocs /var/www + +COPY entrypoint.sh /entrypoint.sh + WORKDIR /var/www EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/devops/entrypoint.sh b/devops/entrypoint.sh new file mode 100644 index 0000000..a6c50f1 --- /dev/null +++ b/devops/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +printf "\n\nStarting PHP daemon...\n\n" +php-fpm --daemonize + +printf "Starting Nginx...\n\n" +set -e + +if [[ "$1" == -* ]]; then + set -- nginx -g daemon off; "$@" +fi + +exec "$@" \ No newline at end of file