Code Monkey home page Code Monkey logo

docker-starter's People

Contributors

basilelt avatar bastnic avatar caneco avatar clairecoloma avatar damienalexandre avatar dependabot[bot] avatar hedicguibert avatar hhamon avatar jbdelhommeau avatar joelwurtz avatar jorickpepin avatar kelplant avatar kissifrot avatar korbeil avatar lbrunet avatar lyrixx avatar marionleherisson avatar matthieuwerner avatar nispeon avatar pyrech avatar qboot avatar remyvanlerberghe avatar roincent avatar romaixn avatar sfavot avatar ternel avatar welcomattic avatar xavierlacot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-starter's Issues

probleme 502 bad gateway by nginx

Hello Jolicode, Hello @damienalexandre,

J'utilise toujous avec grand plaisir votre stack.

Je suis tombΓ© sur un petit soucis de cache ces derniers temps avec des pages tjs en 502 bad gateway

En ajoutant dans le nginx.conf, ça semble résoudre le problème
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;

Je ne sais pas si vous voulez integrer la modif !

Bonne journΓ©e Γ  vous

Xavier

[RFC] Plugin system

Hello,

I think that it could be cool to add a plugin system, for specific use cases, that we don't want to implement directly in the starter.

Docker starter is a amazing tool to start a lot of types of projects using docker. We could perform some plugins to increase it relevance by adding a layer on it, with more dedicated containers and pre built configuration like :

  • complex web applications (with functional build of elastic search, redis, varnish, etc. )
  • serveless applications
  • frontend applications
  • ...

An idea of how it could be work :

How to upgrade or fix Composer version

At the moment, composer is built-in on the "builder" image:

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

It means the Composer version you have depends on WHEN you builded the image / the project. So if I boot a very old project I was working on, it could have an old version of Composer.
But if I install this same project on a different machine, I will have the latest Composer.

My main issue today is that I have to destroy my "builder" image to upgrade Composer.

And as I notice this, I also fear that not specifying the major version of this critical build tool could introduce some surprises in the future (imagine, Composer 2.0, not 100% compatible with projects built years ago... You notice the error only when re-installing the project πŸ’₯).

Better DX with SSL certificates with mkcert

Currently, SSL is available by default with auto-signed certificates. We already propose an alternative in a cookbook about Mkcert.

I suggest that we no longer provide self-signed SSL certificates BUT a start of the infrastructure should run by default a modified version of the task generate_certificates.

  • if certifcates are already generated, do nothing;
  • else it should generate certificates with mkcert if the tool is available;
  • else it should generate auto-signed certificates with the script in infrastructure/docker/services/router/generate-ssl.sh (it could ask a confirmation before generating certificates but I prefer that it works out of the box without having to do anything).

Add `fab ps` command

docker ps is nice to get an overview of what is running. But it gets more complicated when one wants to see what is down.

I have see several projects with fab ps command and it think it's a good idea.

I think I would be faster to add it by myself but with this issue:

  1. I can get feedback: πŸ‘ or πŸ‘Ž
  2. Someone could contribute it for the hacktoberfest πŸŽ‰

The new Asset Mapper `importmap:install` command is missing

Since Symfony Asset Mapper v6.4, a new command was introduced : importmap:install, which populates the new assets/vendor directory.

Running castor start on a project using Asset Mapper 6.4 will result in some 500 errors because this directory will be empty, since this new command is never ran.

However, adding it is quite painful because we must check that the current project is actually using Asset Mapper and at least in v6.4.

So, maybe we shouldn't do anything and let the concerned projects add a docker_compose_run('bin/console importmap:install'); to their install() function themselves ?

But then, we should probably at least update the README to notify users about it ?

CI is red: Encountered a version of Setuptools that no longer supports this version of Python

#!/bin/bash -eo pipefail 
set -e 
pip install --user pipenv 
~/.local/bin/pipenv install 
 
Collecting pipenv
 
  Downloading https://files.pythonhosted.org/packages/f6/fe/0adf70655fc4b6f0118f22489b3aac80b6f8a2cb38dd4bf071427eb82c14/pipenv-2020.6.2-py2.py3-none-any.whl (3.9MB)
 
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.9MB 284kB/s eta 0:00:0101
 
Collecting enum34 (from pipenv)
 
  Downloading https://files.pythonhosted.org/packages/6f/2c/a9386903ece2ea85e9807e0e062174dc26fdce8b05f216d00491be29fad5/enum34-1.1.10-py2-none-any.whl
 
Collecting pip>=18.0 (from pipenv)
 
  Cache entry deserialization failed, entry ignored
 
  Downloading https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl (1.5MB)
 
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.5MB 783kB/s eta 0:00:011
 
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages (from pipenv)
 
Collecting virtualenv-clone>=0.2.5 (from pipenv)
 
  Downloading https://files.pythonhosted.org/packages/83/b8/cd931487d250565392c39409117436d910232c8a3ac09ea2fb62a6c47bff/virtualenv_clone-0.5.4-py2.py3-none-any.whl
 
Collecting typing (from pipenv)
 
  Downloading https://files.pythonhosted.org/packages/22/30/64ca29543375759dc589ade14a6cd36382abf2bec17d67de8481bc9814d7/typing-3.7.4.1-py2-none-any.whl
 
Collecting certifi (from pipenv)
 
  Downloading https://files.pythonhosted.org/packages/98/99/def511020aa8f663d4a2cfaa38467539e864799289ff354569e339e375b1/certifi-2020.4.5.2-py2.py3-none-any.whl (157kB)
 
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 163kB 6.5MB/s eta 0:00:01
 
Collecting setuptools>=36.2.1 (from pipenv)
 
  Downloading https://files.pythonhosted.org/packages/12/86/59b9683467659dcaf2729d7bbfa1d05a83ec417863bca73367e68d299281/setuptools-47.3.0.zip (870kB)
 
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 880kB 1.4MB/s eta 0:00:01
 
    Complete output from command python setup.py egg_info:
 
    pkg_resources/py2_warn.py:15: UserWarning: Setuptools no longer works on Python 2
 
    ************************************************************
 
    Encountered a version of Setuptools that no longer supports
 
    this version of Python. Please head to
 
    https://bit.ly/setuptools-py2-sunset for support.
 
    ************************************************************
 
      warnings.warn(pre + "*" * 60 + msg + "*" * 60)
 
    
 
    ----------------------------------------
 
Command "python setup.py egg_info" failed with error code 32 in /tmp/pip-build-4TBFDH/setuptools/
 
You are using pip version 8.1.1, however version 20.1.1 is available.
 
You should consider upgrading via the 'pip install --upgrade pip' command.
 
 
Exited with code exit status 1 
CircleCI received exit code 1 

We must update our build process (pip ?)

support for Docker Compose v2

Hi!

Docker Compose v1 is EOL and deprecated, and it would be great to use the system's docker compose instead of Python's docker-compose.

The problem is that when you replace cmd = 'docker-compose -p %s %s %s' % ( with cmd = 'docker compose -p %s %s %s' % ( on line 295 of tasks.py, the environment vars are not taken into account anymore (even though they're passed to c.run on ligne 308) and the runner fails to build if the Dockerfile uses an env var.

Add a way to leverage exit_code in docker_compose_run commands

We run a lot of docker_compose_run function, but the output is not really nice:

In utils.php line 194:

The command "'docker' 'compose' '-p' 'app' '-f' '/home/dalexandre/Dev/MyApp/infrastructure/docker/docker-compose.yml' '-f' '/home/dalexandre/Dev/MixWith
TheMasters/infrastructure/docker/docker-compose.worker.yml' '-f' '/home/dalexandre/Dev/MyApp/infrastructure/docker/docker-compose.builder.yml' '--env-fil
e=/home/dalexandre/Dev/MyApp/application/.env' 'run' '--rm' '--no-deps' 'builder' '/bin/sh' '-c' 'exec bin/phpunit'" failed.

qa:tests

We should find a way to improve this.

The default output should not be the full command but only my task: bin/phpunit.

I think castor exit_code do that. Maybe it could be a context option?

Use M1 compatible base images?

On some projects we have to add this to our Docker Compose files (platform: linux/amd64);

version: '3.7'

volumes:
    builder-data: {}

services:
    php-base:
        build: services/php-base
        platform: linux/amd64

    builder:
        build: services/builder
        platform: linux/amd64

To allow Macbooks with M1 chips to build.

It run but then it's painfully slow.

Could it be that our base images are not M1 compatible? Could we found images that runs anywhere?

Forward CI env vars in Docker containers

Now that some of our tools (like PHPStan & Symfony linters) adapt their output when they run on CI, we could make it working inside our Docker infrastructure.

For this to work we probably only need to forward all CI env vars to the builder container - in which our tools are executed.

Symfony app on root

Hi!
Can we have the symfony app on the root of the project instead of in a subdirectory app? If yes, what we should set in env.project_directory ?
Thanks

Build order for containers

Hi,

I was trying to use the stack on a recently installed machine and encountered the following error on fab start:

ERROR: Service 'frontend' failed to build: pull access denied for feedback_basephp, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

I fixed it using by manually running :

PROJECT_NAME=feedback docker-compose -p feedback -f ./infrastructure/docker/docker-compose.builder.yml -f ./infrastructure/docker/docker-compose.yml build --build-arg PROJECT_NAME=feedback --build-arg USER_ID=1000 php-base

I'm not sure what the "correct" way to fix this is, but I would be surprised to be the only one experiencing this error.

Thank you 😺

Unable to contact frontend service from builder

Hello,

In our environment we need to be able to keep network_mode: "host" for router service while being able to connect to frontend one from builder service, for functional testing purpose with Panther ( ❀️ ).
However using this mode Panther doesn't know how to reach the application on frontend (specified using PROJECT_DOMAINS).

Do you have any idea on how to do it?

Fabric 2.0 / Python 3 support

Since Python 2.7 is reaching EOL, and Fabrix 1.x isn't compatible with 3.x version, would it be possible to have the fabfile.py upgraded to use Fabrix 2.x and Python 3.x?

However they seem to have broken almost the whole API and the doc migrations are...awkward :(

Another alternative would be Fabric-classic

Expose mysql

Hi all,
First, thank you to share this docker-starter.
Is it possible to expose PG/mysql during development ? by example for use database tool, like Dbeaver ?
Or it's a bad practice ?
Thank you !

Outdated webpack config

It looks like the documentation contained in your README to use docker-starter with webpack is outdated (using options which do not exist anymore).

I created an issue instead of a PR to directly correct the documentation because I have absolutely no idea of how to fix that... πŸ˜…

Find a workaround to have multiple projects running and talking on MacOS

We want to use two Docker stater based project at the same time.

And project A needs to talk to project B.

It works well on Linux but as the network_mode "host" is not available on MacOS and Windows, we are stuck.

# Docker for Mac or Windows does not support the "network_mode=host"
# So we use the default network mode and we map all needed ports

docker/for-mac#1031

We added this on our frontend from project A:

    frontend:
        build: services/frontend
        extra_hosts:
            - 'project-b.test:172.17.0.1' # Allow talking to project B, docker0 IP

Improve the "help" / default, list the URL's on demand

At the end of "inv start" we print all the configured URL:

docker-starter/tasks.py

Lines 51 to 53 in c7bdf35

print(Fore.GREEN + 'You can now browse:')
for domain in [c.root_domain] + c.extra_domains:
print(Fore.YELLOW + "* https://" + domain)

image

That's awesome but we can never this is again, unless running "inv start" again.

Would be awesome if the help / task list could add this. Or add a "inv help" or "inv url" command to get the list back any time.

WDYT?

Composer cache location

The composer global config cache-dir -q command ran on the host can return a different result.

For example, on Debian 5.5 with composer 1.10.6 it's ~/.cache/composer instead of ~/.composer/cache.

As the volume mounted for the builder use the second option, a non reusable ~/.composer/cache folder is created (with root) on my host.

I "solved" the problem using a symlink but if you have a more elegant solution, don't hesitate to tell me. :)

Warning on /services/builder/Dockerfile with apt-key

It should be great to remove the warning on the builder Dockerfile because of the programmatically usage of apt-key :
Warning: apt-key output should not be parsed (stdout is not a terminal)

It seems that there 2 ways to remove this warning :

  • Using the environnement variable APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE
  • Redirect stdout to /dev/null

Both seems ignoring the real security content of the message πŸ‘Ž

 apt-key is used to manage the list of keys used by apt to authenticate
   packages. Packages which have been authenticated using these keys will
   be considered trusted.
   Note that if usage of apt-key is desired the additional installation of
   the GNU Privacy Guard suite (packaged in gnupg) is required. For this
   reason alone the programmatic usage (especially in package maintainer
   scripts!) is strongly discouraged. Further more the output format of all
   commands is undefined and can and does change whenever the underlying
   commands change.  apt-key will try to detect such usage and generates
   warnings on stderr in these cases.

=> For this reason alone the programmatic usage (especially in package maintainer scripts!) is strongly discouraged.

Solution 1 : using an older version of nodejs who is officially supported by this version of Debian 😒
Solution 2 : accept this warning (it's working with)
Solution 3 : ... feel free to propose any better solution :)

Consider switching to Debian as base image

Currently, we are using Alpine as the base image for almost all services. At the time, this was the recommended base image and Docker themself move their own images on Alpine too.

2020 could be the year we switch back to Debian as nowadays they provide official image that no so big (like debian:buster-slim?). Here is some pro/cons:

Pros:

  • a dev env more similar to classical prod env
  • easier to use latest PHP version (almost impossible with Alpine)
  • Alpine uses the musl library instead of classical libc, which used to break some tool like Blackfire

Cons:

  • base image a bit bigger (~5Mo VS 60Mo)
  • more different base images among all services thus more images to build and store
  • bigger and different base images also slow CI build and can cost more credits (but should be less problematic than when we used normal Debian images weighting 500Mo)

Some read:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.