From 191c373debfcf319010d9a197bcb57bebd0fe97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 16 Sep 2023 15:07:24 +0200 Subject: [PATCH] add new dockerfile with dev and release stages --- docker/Dockerfile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docker/Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..cfa360e --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:focal AS mapg_base + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt update --fix-missing && apt install -y curl git unzip mariadb-client nginx \ + php-apcu php7.4-cli php7.4-curl php7.4-fpm php7.4-mbstring php7.4-mysql php7.4-zip php7.4-xml + +RUN mkdir -p /run/php +COPY docker/configs/nginx.conf /etc/nginx/sites-available/default + +COPY docker/scripts/install-composer.sh install-composer.sh +RUN ./install-composer.sh + +COPY docker/scripts/install-nodejs.sh install-nodejs.sh +RUN ./install-nodejs.sh +RUN npm install -g uglify-js clean-css-cli svgo yarn + + +FROM mapg_base AS mapg_dev + +RUN apt update --fix-missing && apt install -y php-xdebug + +RUN echo "xdebug.remote_enable = 1" >> /etc/php/7.4/mods-available/xdebug.ini &&\ + echo "xdebug.remote_autostart = 1" >> /etc/php/7.4/mods-available/xdebug.ini &&\ + echo "xdebug.remote_connect_back = 1" >> /etc/php/7.4/mods-available/xdebug.ini + +EXPOSE 80 +EXPOSE 5000 +EXPOSE 8090 +EXPOSE 9229 +ENTRYPOINT docker/scripts/entry-point-dev.sh + +FROM mapg_base AS mapg_release + +RUN apt update --fix-missing && apt install -y cron + +WORKDIR /var/www/mapguesser +COPY ./ /var/www/mapguesser +RUN docker/scripts/release.sh &&\ + rm -rf /var/www/mapguesser/.git /var/www/mapguesser/.env + +EXPOSE 80 +EXPOSE 8090 +ENTRYPOINT docker/scripts/entry-point.sh