Created
March 20, 2017 15:56
-
-
Save darookee/d29d719f03a9d2c1b92d7803a19d980f to your computer and use it in GitHub Desktop.
Run opus in docker-container
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
#!/bin/sh | |
cd /var/www/html | |
if [ -f "./.env" ]; then | |
source .env | |
fi | |
composer install --no-plugins --no-scripts && | |
php artisan migrate | |
if [ -z "$FIRST_RUN" ]; then | |
php artisan key:generate | |
php artisan db:seed | |
fi | |
chown www-data:www-data . -Rf | |
if [ "${1#-}" != "$1" ]; then | |
set -- apache2-foreground "$@" | |
fi | |
exec "$@" |
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
FROM php:7.1-apache | |
RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \ | |
&& apt-get update > /dev/null \ | |
&& apt-get install -yyq \ | |
git \ | |
curl \ | |
unzip \ | |
> /dev/null \ | |
&& docker-php-ext-install \ | |
pdo_mysql \ | |
iconv \ | |
pdo \ | |
> /dev/null \ | |
&& docker-php-ext-enable \ | |
pdo_mysql \ | |
iconv \ | |
pdo \ | |
> /dev/null \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
RUN a2enmod rewrite | |
RUN sed -i /etc/apache2/sites-enabled/000-default.conf -e "s#www/html#www/html/public#" | |
RUN curl -Lo /usr/local/bin/composer https://getcomposer.org/composer.phar \ | |
&& chmod +x /usr/local/bin/composer | |
COPY . /var/www/html/ | |
RUN chmod +x /var/www/html/docker-entrypoint.sh | |
ENTRYPOINT ["/var/www/html/docker-entrypoint.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Men, there are a way for externalize de database to other docker container or volumen?