-
-
Save hgrimelid/bbd04600a0349692fa023cc30f4f9ca9 to your computer and use it in GitHub Desktop.
Laravel 8 + PHP 8.0 in Docker
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
DB_CONNECTION=mysql | |
DB_HOST=host.docker.internal | |
DB_PORT=33060 | |
DB_DATABASE=mydb | |
DB_USERNAME=root | |
DB_PASSWORD=password |
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
version: '3.8' | |
services: | |
main: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
command: 'php artisan serve --host=0.0.0.0' | |
volumes: | |
- .:/app | |
ports: | |
- 8000:8000 | |
depends_on: | |
- db | |
db: | |
image: mysql | |
ports: | |
- 33060:3306 | |
environment: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: realestate |
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:8.0-fpm-alpine | |
RUN apk add --no-cache zip libzip-dev | |
RUN docker-php-ext-install pdo pdo_mysql sockets exif zip | |
RUN curl -sS https://getcomposer.org/installer | php -- \ | |
--install-dir=/usr/local/bin --filename=composer | |
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | |
WORKDIR /app | |
COPY . . | |
RUN composer install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment