Vers des applications twelve-factor

88b8138397e1d1441f4e4a54348bde09?s=47 ubermuda
October 24, 2014

Vers des applications twelve-factor

La méthodologie "12 factor" (http://12factor.net/) promet des applications SaaS (Software-as-a-Service) plus maintenables et scalables.

Comment ? Pourquoi ? Voyons ensemble quelles sont les préconisations de cette méthodologie développée par des ingénieurs d'Heroku, et comment les appliquer dans des applications basées sur le framework Symfony2, avec l'aide de la technologie la plus prometteuse du moment : Docker.

88b8138397e1d1441f4e4a54348bde09?s=128

ubermuda

October 24, 2014
Tweet

Transcript

  1. 3.
  2. 4.

    Use declarative formats for setup automation Clean contract with the

    underlying operating system Suitable for deployment on modern cloud platforms Minimize divergence between development and production Can scale up without significant changes ”
  3. 5.

    Codebase Dependencies Config Backing services Build, release, run Processes Port

    binding Concurrency Disposability Dev/prod parity Logs Admin processes
  4. 15.

    Codebase one app = one codebase multiple codebases = a

    distributed system one codebase -> many deploys
  5. 18.
  6. 23.
  7. 24.

    Resource handles to the database, Memcached Credentials to external services

    such as Amazon S3 or Twitter Per-deploy values such as the canonical hostname for the deploy ”
  8. 33.

    A backing service is any service the app consumes over

    the network as part of its normal operation. ”
  9. 34.

    Datastore (MySQL, PgSQL, Redis, ...) SMTP (Postfix, Mandril, ...) Message

    Queue (RabbitMQ, ZeroMQ, ...) API tierce (Twitter, Facebook, etc)
  10. 47.
  11. 75.

    Objectifs Réduire la friction entre le dev et la prod

    Réduire le "time-to-first-deploy" Faciliter l'intégration continue
  12. 78.

    web: image: mytepee/web ports: [80] links: [db:db] volumes_from: [cache, config,

    data] environment: [...] db: image: orchardup/mysql environment: [...] cache: image: busybox command: /bin/true volumes: [/root/.composer/cache, /root/.cache/bower] config: image: busybox command: /bin/true volumes: [/app/config] data: image: busybox command: /bin/true volumes: [/app/web/uploads, /app/web/media, ..., /app/app/cache, /app/app/logs] fig.yml Attention à la sécurité !
  13. 80.
  14. 91.

    One-off admin processes should be run in an identical environment

    as the regular long-running processes of the app. ”
  15. 95.

    Run a one-off command on a service. For example: $

    fig run web python manage.py shell By default, linked services will be started, unless they are already running. If you do not want to start linked services, use `fig run --no-deps SERVICE COMMAND [ARGS...]`. fig.yml