Skip to content

🐳 Dockerized your Symfony project using a complete stack (Makefile, Docker-Compose, CI, bunch of quality insurance tools, tests ...) with a base according to up-to-date components and best practices.

Notifications You must be signed in to change notification settings

GaetanRole/symfony-lts-docker-starter

Repository files navigation

symfony-lts-docker-starter

Symfony Docker starter is an up-to-date Symfony project (4.4 version) with a whole Docker stack, using a CI (Gitlab-CI here) and so on, according to best practices on a set of components listed below.

Software License

Author

You can take this repository and replace the Symfony project in it, with your, to take advantage of the Docker stack. Remember to keep the Symfony Makefile.

Installation instructions

Docker contents

Project dependencies

Take a look on app/symfony/composer.json and app/symfony/package.json.

Project requirements

Suggested requirements (for Mac and Windows)

Tree view

app/ symfony/ Makefile ... docker/ nginx/ web/ .gitlab-ci.yml docker-compose.gitlab-ci.yml docker-compose.override.yml.dist docker-compose.yml Makefile README.md 

Project view

Alt text

Installation

$ make install

You can edit the new docker-compose.override.yml and app/symfony/.env.local with your own configuration for DB, Docker ports and PHPStorm configuration.

Keep in mind that you can use both Makefiles, especially the one specific to Symfony directory make symfony:"rule" and independent from Docker. If Composer stops due to memory, launch it separately or increase the size of your containers.

Usage

Go on: http://localhost:8080/ (or another port specified in your ./docker-compose.override.yml)

- Wanna use something ?

$ make # Self documented Makefile $ make stop # Stop Docker containers ## Samples calling Symfony Makefile and bin/console from root folder $ make symfony:update # Use app/symfony/Makefile update rule $ make sf-console:translation:update ARGS="--output-format xlf --dump-messages --force en" # Use bin/console $ make sf-console:c:c ARGS="--env=dev"

Take a look on Makefile rules to know which commands to use.

Tests

$ make symfony:tests # Behat and PHPUnit tests $ make symfony:qa # Quality & Assurance tools

Docker advice

If you want to fully merge your Symfony application with Docker and not take advantage of my design, you can keep this directory structure but split dependencies in different Docker containers. For example, with Node dependency (for Yarn used by Webpack-Encore):

# In docker-compose.yml node: build: ./docker/node container_name: starter_node working_dir: /srv restart: on-failure # In docker-compose.override.yml node: volumes: - "./:/srv" # Create a Node Dockerfile FROM node:13.10-alpine LABEL maintainer="Gaëtan Rolé-Dubruille <gaetan.role@gmail.com>" RUN apk add --no-cache su-exec && \ addgroup bar && \ adduser -D -h /home -s /bin/sh -G bar foo RUN apk add yarn --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ && \ yarn install COPY ./bin/entrypoint.sh /usr/local/bin/entrypoint RUN set -o errexit -o nounset -o xtrace; \ chmod a+x /usr/local/bin/entrypoint ENTRYPOINT ["/usr/local/bin/entrypoint"] 
# In Makefile, call Yarn from the Node container YARN = $(DOCKER_COMPOSE) exec -T node /usr/local/bin/entrypoint yarn

Contributing

Do not hesitate to improve this repository, creating your PR on GitHub with a description which explains it.

Ask your question on gaetan.role@gmail.com.

About

🐳 Dockerized your Symfony project using a complete stack (Makefile, Docker-Compose, CI, bunch of quality insurance tools, tests ...) with a base according to up-to-date components and best practices.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •