Skip to content

Instantly share code, notes, and snippets.

@marcusandre
Last active March 18, 2019 15:50
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 marcusandre/9c1c95af2dceab9a18fa2ff0e2ce1e3f to your computer and use it in GitHub Desktop.
Save marcusandre/9c1c95af2dceab9a18fa2ff0e2ce1e3f to your computer and use it in GitHub Desktop.
run your Lumen development efforts with docker.
version: '3'
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: seat
MYSQL_USER: seat
MYSQL_PASSWORD: seat2019
ports:
- 3306:3306
volumes:
- db_data:/var/lib/mysql
adminer:
image: adminer
ports:
- 8081:8080
php:
build: .
ports:
- '8080:80'
volumes:
- ./seat:/var/www/html
volumes:
db_data:
FROM php:7.3-apache
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
RUN docker-php-ext-install pdo pdo_mysql
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
RUN a2enmod rewrite
@marcusandre
Copy link
Author

Just to get you started:

$ cp lumen/.env.example lumen/.env
$ docker-compose up -d
$ docker-compose exec php php artisan migrate

Then open http://localhost:8080/ inside your browser.

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