Invalid type error in Docker Compose

Did you try with quotes on ports? version: ‘2’ services: api: build: context: . dockerfile: webapi/dockerfile ports: – 210 web: build: context: . dockerfile: app/dockerfile ports: – 80 lbapi: image: dockercloud/haproxy links: – api ports: – “8080:210” lbweb: image: dockercloud/haproxy links: – web ports: – “80:80”

Using environment variable for volume name in docker compose

This is expected behavior – Compose only does variable interpolation in values, not keys. See here. In my project I use external structure: version: ‘3.1’ services: ### Code from branch develop ### applications: image: registry.gitlab.lc:5000/develop/ed/develop.sources:latest volumes: – developcode:/var/www/develop deploy: replicas: 1 update_config: parallelism: 1 delay: 5s restart_policy: condition: on-failure placement: constraints: [node.role == manager] ### … Read more

What is the difference between the `–build` and `–force-recreate` flags to `docker-compose up`?

As mentioned in a doc, or the help of docker-compose up, –build: build images before starting containers. –force-recreate: Recreate containers even if their configuration and image haven’t changed. –build is a straightforward and it will create the docker images before starting the containers. The –force-recreate flag will stop the currently running containers forcefully and spin … Read more

docker compose environment variable for command

The variables are being read by Compose when the file is parsed. But setting environment only provides values to the container, not to the file parsing. If you’re trying to pass those variables into the container, you need to escape them in the command using an extra $ -Dconfig.home=$${CONF_HOME} -Dcomponent.name=LMS -Denv=$${APP_ENV} -Duser.dir=/tmp/ -DLMS_UUID=$${UUID If you’re … Read more

Inheritance or nesting with docker compose

With docker-compose 1.6 this should be possible. Create a docker-compose.yml with your common services: service01: image: image01 links: – service02 service02: image: image02 And a second file, docker-compose.prod.yml with your unique services: service03: image: image03 links: – service02 Now you can start service 01, 02 and 03 with this command: docker-compose -f docker-compose.yml -f docker-compose.prod.yml … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)