Are you using Docker for development, because … it’s the future? And sometimes wish you had your boring, but nicely working development environment back? Containers certainly are the future, now let’s identify and sort out all those little problems which keep you from using it today effectively.
When Docker hit the scene, many developers (including me) started using containers as a lightweight alternative to virtual machines. It was promising to use Docker as a local environment for development which would closely match the software running on the production servers. But the cake was a lie, all sorts of practical issues spoiled the fun.
In this session I’ll share what I learned throughout the last four years of using Docker as a development (and production) environment and how you can create your own set-up taking full advantage of the benefits containers provide. See an example for a fully working solution tailored to Neos and Flow and learn how it works internally
38. version: '3'
networks:
local_beach:
external:
name: local_beach
services:
webserver:
image: ${BEACH_WEBSERVER_IMAGE:-flownative/beach-nginx}:${BEACH_WEBSERVER_IMAGE_VERSION:-latest}
container_name: ${BEACH_PROJECT_NAME:?Please specify a Beach project name as BEACH_PROJECT_NAME}_webserver
networks:
- local_beach
ports:
- "80"
volumes:
- .:/application:delegated
environment:
- VIRTUAL_HOST=${BEACH_PROJECT_NAME}.localbeach.net
- BEACH_PHP_FPM_HOST=${BEACH_PROJECT_NAME:?Please specify a Beach project name as BEACH_PROJECT_NAME}_php.local_beach
- BEACH_FLOW_BASE_CONTEXT=${BEACH_FLOW_BASE_CONTEXT:-Development}
- BEACH_FLOW_SUB_CONTEXT=${BEACH_FLOW_SUB_CONTEXT:-Instance}
- BEACH_PHP_MEMORY_LIMIT=${BEACH_PHP_MEMORY_LIMIT:-750M}
php:
image: ${BEACH_PHP_IMAGE:-flownative/beach-phpfpm}:${BEACH_PHP_IMAGE_VERSION:-latest}
container_name: ${BEACH_PROJECT_NAME:?Please specify a Beach project name as BEACH_PROJECT_NAME}_php
networks:
- local_beach
ports:
- "${BEACH_SSH_PORT:-2222}:22"
depends_on:
- webserver
- redis
volumes:
- ./Data/Persistent:/application/Data/Persistent:delegated
- ./Data/Logs:/application/Data/Logs:delegated
- ./Data/DoctrineMigrations:/application/Data/DoctrineMigrations
- .:/application-on-host:delegated
- ./.LocalBeach/secrets:/secrets
- ./.LocalBeach/home:/home/beach
- ./Web:/application/Web:delegated
environment:
- BEACH_PHP_FPM_ENABLE=true
.localbeach.docker-compose.yaml
39. #
# Environment variables for the Local Beach Docker Compose setup
#
BEACH_PROJECT_NAME=neos-demo
# Change the PHP version to the branch you use in your Beach instances.
# Examples: 7.3 for PHP 7.3.x
BEACH_PHP_IMAGE_VERSION=7.3
# If you are running multiple Local Beach projects on your computer,
# set the following port to a value which is not used by other projects
# or applications yet:
BEACH_SSH_PORT=2122
.localbeach.dist.env