environment variables not recognized in docker compose

Advertisements Environment variables defined in docker-compose.yml are not set. services: service1: image: alpine environment: – VAR1:H – VAR2:HI command: – /bin/sh – -c – | echo $VAR1 echo $VAR2 This outputs: $ docker compose up WARN[0000] The "VAR1" variable is not set. Defaulting to a blank string. WARN[0000] The "VAR2" variable is not set. Defaulting… Read More environment variables not recognized in docker compose

Docker compose – how to access database?

Advertisements I created a MySQL Database via docker (and docker compose command) using this configuration: version: ‘3.8’ services: db: image: mysql volumes: – ./data/mysql:/var/lib/mysql ports: – ‘3306:3306’ environment: MYSQL_ROOT_PASSWORD: ‘root’ MYSQL_DATABASE: ‘test’ I tried to access http://localhost:3306 but it tells me that the page is currently not working. Is the link I am using wrong… Read More Docker compose – how to access database?

Docker compose – how to access database?

Advertisements I created a MySQL Database via docker (and docker compose command) using this configuration: version: ‘3.8’ services: db: image: mysql volumes: – ./data/mysql:/var/lib/mysql ports: – ‘3306:3306’ environment: MYSQL_ROOT_PASSWORD: ‘root’ MYSQL_DATABASE: ‘test’ I tried to access http://localhost:3306 but it tells me that the page is currently not working. Is the link I am using wrong… Read More Docker compose – how to access database?

How does Docker decide whether a service persists?

Advertisements Given this simple Docker compose.yaml file: services: test: image: node:18 website: image: nginx After running: docker compose up docker ps I expected to see two running containers/images. Instead I got just the one: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c970ef47fb93 nginx "/docker-entrypoint.…" 51 seconds ago Up 48 seconds 80/tcp myid-website-1 What is… Read More How does Docker decide whether a service persists?

Docker Compose with multiple .yml files and same shared network not resolving container names to ip adress

Advertisements I have two docker compose yml files. Both should use the same network. First is the backend project with database, second a Angular frontend. I tried the follow: BACKEND version: "3.7" services: ……. MySQL and so on backend: container_name: backend build: . ports: – 3000:3000 depends_on: – db networks: – explorer-docs-net networks: explorer-docs-net: name:… Read More Docker Compose with multiple .yml files and same shared network not resolving container names to ip adress

How do I add a folder with yaml configuration to docker using docker-compose?

Advertisements I have a project structure: configs -config.yaml server … docker-compose.yaml the docker file is : version: ‘3.8’ services: volumes: – /configs:/configs postgres: image: postgres:12 restart: always ports: – ‘5432:5432’ volumes: – ./db_data:/var/lib/postgresql/data – ./server/scripts/init.sql:/docker-entrypoint-initdb.d/create_tables.sql env_file: – local.env healthcheck: test: [ "CMD", "pg_isready", "-q", "-d", "devdb", "-U","postgres" ] timeout: 45s interval: 10s retries: 10 app:… Read More How do I add a folder with yaml configuration to docker using docker-compose?

Make the same thing made with docker-compose on k8s

Advertisements Is there a way to run the docker-compose app identically on k8s? Currently the content of my docker-compose.yml file is as follows: version: "3" services: registry: restart: always image: registry:2 ports: – 5000:5000 environment: REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt REGISTRY_HTTP_TLS_KEY: /certs/domain.key REGISTRY_AUTH: htpasswd REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm volumes: – /home/app/docker/test/data:/var/lib/registry – /home/app/docker/test/certs:/certs – /home/app/docker/test/auth:/auth nginx: container_name:… Read More Make the same thing made with docker-compose on k8s

Make the same thing made with docker-compose on k8s

Advertisements Is there a way to run the docker-compose app identically on k8s? Currently the content of my docker-compose.yml file is as follows: version: "3" services: registry: restart: always image: registry:2 ports: – 5000:5000 environment: REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt REGISTRY_HTTP_TLS_KEY: /certs/domain.key REGISTRY_AUTH: htpasswd REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm volumes: – /home/app/docker/test/data:/var/lib/registry – /home/app/docker/test/certs:/certs – /home/app/docker/test/auth:/auth nginx: container_name:… Read More Make the same thing made with docker-compose on k8s