|
| 1 | +FROM ubuntu:20.04 |
| 2 | + |
| 3 | +ENV DEBIAN_FRONTEND noninteractive |
| 4 | + |
| 5 | +RUN adduser --disabled-password --gecos '' pathfinder |
| 6 | + |
| 7 | +# INSTALL PACKAGES |
| 8 | +RUN apt-get update --fix-missing && \ |
| 9 | + apt-get install -y software-properties-common && \ |
| 10 | + LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ |
| 11 | + apt-get update && \ |
| 12 | + apt-get update --fix-missing |
| 13 | + |
| 14 | +RUN apt-get install -y \ |
| 15 | + sudo \ |
| 16 | + php7.2 \ |
| 17 | + php7.2-gd \ |
| 18 | + php7.2-xml \ |
| 19 | + php7.2-fpm \ |
| 20 | + php7.2-mysql \ |
| 21 | + php7.2-mbstring \ |
| 22 | + php7.2-curl \ |
| 23 | + php7.2-redis \ |
| 24 | + php7.2-dev \ |
| 25 | + gzip \ |
| 26 | + wget \ |
| 27 | + nginx \ |
| 28 | + zip \ |
| 29 | + git \ |
| 30 | + redis-server \ |
| 31 | + curl \ |
| 32 | + cron \ |
| 33 | + libjpeg-dev \ |
| 34 | + libpng-dev \ |
| 35 | + graphicsmagick |
| 36 | + |
| 37 | +# ADD NODE |
| 38 | +RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - |
| 39 | +RUN apt-get install -y \ |
| 40 | + nodejs |
| 41 | + |
| 42 | +# COPY PATHFINDER |
| 43 | +ARG VERSION |
| 44 | +RUN mkdir /var/www/pathfinder |
| 45 | +RUN mkdir /var/log/cron-www/ |
| 46 | +RUN git clone https://github.com/fish-vending-machine/pathfinder.git /var/www/pathfinder |
| 47 | +COPY ./config/composer.json /root/.composer/config.json |
| 48 | +RUN chown -R www-data:www-data /var/www/pathfinder |
| 49 | +RUN mkdir /tmp/cache/ |
| 50 | +RUN mkdir /var/www/pathfinder/conf/ |
| 51 | +RUN chmod -R 766 /tmp/cache/ /var/www/pathfinder/logs/ |
| 52 | + |
| 53 | +# COMPOSER INSTALL - NOTE: there is an issue with composer 1.10.x and above working withe Pathfinder v 2.0 so we need to use version 1.9.3 |
| 54 | +RUN curl -sS https://getcomposer.org/installer | php -- --version=1.9.3 |
| 55 | +RUN mv composer.phar /usr/local/bin/composer |
| 56 | +RUN composer install -d /var/www/pathfinder/ |
| 57 | + |
| 58 | +# COPY PATHFINDER Websocket Server |
| 59 | +RUN mkdir /var/www/pathfinder_websocket |
| 60 | +RUN git clone https://github.com/exodus4d/pathfinder_websocket.git /var/www/pathfinder_websocket |
| 61 | +RUN chown -R www-data:www-data /var/www/pathfinder_websocket |
| 62 | + |
| 63 | +# COPY PATHFINDER Websocket Server service script |
| 64 | +COPY ./config/pathfinder-websocket /etc/init.d/ |
| 65 | +RUN chmod +x /etc/init.d/pathfinder-websocket |
| 66 | + |
| 67 | +# COMPOSER INSTALL Pathfinder Websocket server |
| 68 | +RUN composer install -d /var/www/pathfinder_websocket/ |
| 69 | + |
| 70 | +# CONFIGURE NGINX |
| 71 | +COPY ./config/default /etc/nginx/sites-available/ |
| 72 | +COPY ./config/www.conf /etc/php/7.2/fpm/pool.d/ |
| 73 | + |
| 74 | +# CONFIGURE REDIS |
| 75 | +COPY ./config/redis.conf /etc/redis/ |
| 76 | +RUN chmod 755 /etc/redis/redis.conf |
| 77 | + |
| 78 | +# CONFIGURE PHP7.2-FPM |
| 79 | +COPY ./config/php.ini /etc/php/7.2/fpm/ |
| 80 | + |
| 81 | +# SET UP CRONJOB |
| 82 | +COPY ./config/default_crontab /home/ |
| 83 | +RUN crontab /home/default_crontab |
| 84 | + |
| 85 | +# COPY ENTRYPOINT |
| 86 | +COPY entrypoint.sh /usr/local/bin/ |
| 87 | +RUN chmod +x /usr/local/bin/entrypoint.sh |
| 88 | + |
| 89 | +# RUN GULP |
| 90 | +RUN cd /var/www/pathfinder && npm install && npm run gulp production |
| 91 | + |
| 92 | +ENTRYPOINT ["entrypoint.sh"] |
0 commit comments