Skip to content

Instantly share code, notes, and snippets.

@rolldone
Last active September 25, 2021 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolldone/c5c32504956220179bcb795658752976 to your computer and use it in GitHub Desktop.
Save rolldone/c5c32504956220179bcb795658752976 to your computer and use it in GitHub Desktop.
Dockerfile
FROM node:14.16.1
# Create app directory
RUN npm install nodemon -g
RUN npm install sequelize-cli -g
RUN npm install pm2 -g
RUN npm install gm -g
RUN apt-get update
RUN apt-get install -y nginx
# install Nano
RUN apt-get install -y nano
# install iputils-ping
RUN apt-get install -y iputils-ping
# install net-tools
RUN apt-get install -y net-tools
RUN apt-get install -y graphicsmagick
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh
RUN chmod +x /usr/sbin/wait-for-it.sh
WORKDIR /opt/app
FROM php:7.2-apache
RUN apt-get update -y
# install Nano
RUN apt-get install -y nano
# install iputils-ping
RUN apt-get install -y iputils-ping
# install net-tools
RUN apt-get install -y net-tools
RUN curl -s https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# make sure apt is up to date
RUN apt-get update --fix-missing
RUN apt-get install -y curl
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 9.2.0
# Install nvm with node and npm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
WORKDIR /var/www/html
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd
RUN docker-php-ext-install pdo pdo_mysql mysqli
RUN docker-php-ext-install gd
RUN apt-get install -y libzip-dev zlib1g-dev \
&& docker-php-ext-install zip
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
RUN apt-get install -y cron
RUN apt-get install -y git
RUN apt-get install netcat -y
ADD vhost/000-default.conf /etc/apache2/sites-enabled/000-default.conf
RUN apt-get install supervisor -y
# remove index.php from the URL
RUN a2enmod rewrite
# Join www-data to root group
RUN usermod -a -G root www-data
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment