Last active
August 30, 2016 19:17
-
-
Save thpoiani/20bb5d03a4548ca21b7b1a08fde3a6b1 to your computer and use it in GitHub Desktop.
Dockerfile for VanguardaBrasil applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx-proxy: | |
image: jwilder/nginx-proxy | |
container_name: nginx-proxy | |
ports: | |
- "80:80" | |
volumes: | |
- /var/run/docker.sock:/tmp/docker.sock:ro | |
links: | |
- app | |
app: | |
image: vanguarda/project | |
container_name: "project" | |
environment: | |
- VIRTUAL_HOST=project.local,www.project.local,admin.project.local | |
volumes: | |
- ./app/admin/application/configs/application.ini:/var/www/html/app/admin/application/configs/application.ini | |
- ./app/www//application/configs/application.ini:/var/www/html/app/www/application/configs/application.ini | |
links: | |
- db | |
db: | |
image: mysql:5.7 | |
container_name: "mysql" | |
ports: | |
- "3306:3306" | |
environment: | |
- MYSQL_ROOT_PASSWORD=project | |
- MYSQL_DATABASE=project | |
- MYSQL_USER=project | |
- MYSQL_PASSWORD=project | |
volumes: | |
- ./data:/var/lib/mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker build --rm -t vanguarda/project -f Dockerfile | |
FROM vanguarda/lamp | |
MAINTAINER Thiago Henrique Poiani <[email protected]> | |
# copy project | |
COPY app /var/www/html/app | |
RUN mkdir /var/www/html/app/log /var/www/html/app/cache -p \ | |
&& touch /var/www/html/app/log/admin.log /var/www/html/app/log/www.log \ | |
&& chmod 777 /var/www/html/app/log -R | |
# install depedencies from package.json | |
COPY package.json /var/www/html | |
RUN /bin/bash -l -c "npm install" | |
# install depedencies from composer.json | |
COPY composer.json /var/www/html | |
RUN php composer.phar install | |
COPY default.conf /etc/apache2/sites-available/000-default.conf | |
RUN a2ensite 000-default.conf | |
EXPOSE 80 | |
CMD ["apache2-foreground"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker build --rm -t vanguarda/lamp -f VanguardaDockerfile | |
FROM php:5.6-apache | |
MAINTAINER Thiago Henrique Poiani <[email protected]> | |
WORKDIR /var/www/html | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
zip unzip \ | |
libmcrypt-dev libcurl4-gnutls-dev | |
RUN docker-php-ext-install \ | |
mysql mysqli pdo pdo_mysql \ | |
curl \ | |
mbstring \ | |
mcrypt \ | |
session | |
RUN apt-get update && apt-get install -y \ | |
libfreetype6-dev \ | |
libjpeg62-turbo-dev \ | |
libmcrypt-dev \ | |
libpng12-dev \ | |
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ | |
&& docker-php-ext-install -j$(nproc) gd | |
# install node.js | |
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash | |
RUN /bin/bash -l -c "nvm install node" | |
# install composer | |
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | |
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ | |
&& php composer-setup.php \ | |
&& php -r "unlink('composer-setup.php');" | |
# install ruby | |
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
RUN curl -L https://get.rvm.io | bash -s stable --gems=sass,compass,compass-normalize,sass-globbing,bootstrap-sass | |
# allow rewrite mod on apache | |
RUN a2enmod rewrite | |
EXPOSE 80 | |
CMD ["apache2-foreground"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment