Skip to content

Instantly share code, notes, and snippets.

@darookee
Created March 20, 2017 15:56
Show Gist options
  • Save darookee/d29d719f03a9d2c1b92d7803a19d980f to your computer and use it in GitHub Desktop.
Save darookee/d29d719f03a9d2c1b92d7803a19d980f to your computer and use it in GitHub Desktop.
Run opus in docker-container
#!/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 "$@"
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"]
@SalahAdDin
Copy link

Men, there are a way for externalize de database to other docker container or volumen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment