-
-
Save adrianharabula/57693081e6d66749e6f11ce26a5bedb7 to your computer and use it in GitHub Desktop.
laravel 5 - running in a 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
--- | |
app: | |
build: . | |
# optional, map host port 8000 to container port 80 | |
ports: | |
- 8000:80 | |
environment: | |
# vars available to app | |
VIRTUAL_HOST: laravelapp.com |
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 alpine | |
ENV \ | |
APP_DIR="/app" \ | |
APP_PORT="80" | |
# the "app" directory (relative to Dockerfile) containers your Laravel app... | |
COPY app/ $APP_DIR | |
RUN apk add --update \ | |
curl \ | |
php \ | |
php-opcache \ | |
php-openssl \ | |
php-pdo \ | |
php-json \ | |
php-phar \ | |
php-dom \ | |
&& rm -rf /var/cache/apk/* | |
RUN curl -sS https://getcomposer.org/installer | php -- \ | |
--install-dir=/usr/bin --filename=composer | |
RUN cd $APP_DIR && composer install | |
WORKDIR $APP_DIR | |
CMD php artisan serve --host=0.0.0.0 --port=$APP_PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment