Opinionated base image for Laravel that just works everywhere
3.6K
Laravel Base Image that is optimized for production and configured to operate locally the same way. This image is very opinionated; however, not restrictive.
This image is configured with:
ONBUILD during your docker build process.This image is configured to easily connect a sidecar container running nginx. By doing so, nginx can serve static assets with php requests forwarded to this container.
There are 3 volumes exposed in this image that are shared with the nginx sidecar. These volumes automatically configure nginx to serve static assets and php properly.
See examples/basic/docker-compose.yml for working example for local development.
Update docker-compose.yml. See full example at examples/postgres/docker-compose.yml.
services:
app:
...
environment:
...
- DB_CONNECTION=pgsql
- DATABASE_URL=postgres://acme:acme@db:5432/acme
...
db:
image: postgres
ports:
- 5432:5432
environment:
- POSTGRES_USER=acme
- POSTGRES_PASSWORD=acme
- POSTGRES_DB=acme
Update docker-compose.yml. See full example at examples/redis/docker-compose.yml.
services:
app:
...
environment:
...
- CACHE_DRIVER=redis
- REDIS_URL=tcp://redis:6379/0
...
redis:
image: redis:6-alpine
ports:
- "6379:6379"
Install redis to Dockerfile.
RUN apk add --no-cache pcre-dev $PHPIZE_DEPS \
&& pecl install redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis.so
Content type
Image
Digest
sha256:6051989cf…
Size
52.5 MB
Last updated
about 3 years ago
docker pull nullstone/laravel