question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Help] Config and docker-compose

See original GitHub issue

Hey guys !

I’m using docker-compose for my mysql server, but I’m quite annoyed by having connection configuration in two different places: docker-compose.yml ormconfig.json

Would you have some ideas how to keep the connection in only one place ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

3reactions
joshuamannscommented, Mar 27, 2018

@jcloutz you can also load the .env file within docker-compose using env_file instead of enumerating each value:

version: '3.1'

services:
  pgsql:
    image: postgres:9
    ports:
      - ${TYPEORM_PORT}:5432
    env_file:
      - .env
    volumes:
      - pg_data:/var/lib/postgres/data

volumes:
  pg_data:
1reaction
otroboecommented, Mar 27, 2018

You don’t need to do that with docker-compose, it loads the .env file automatically. https://docs.docker.com/compose/environment-variables/#the-env-file

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview | Docker Documentation
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application's services....
Read more >
Compose specification - Docker Documentation
The Compose file is a YAML file defining version (DEPRECATED), services (REQUIRED), networks, volumes, configs and secrets. The default path for a Compose...
Read more >
Overview of docker compose CLI
Overview of docker compose CLI · Command options overview and help · Use -f to specify name and path of one or more...
Read more >
Share Compose configurations between files and projects
Docker Compose's extends keyword enables the sharing of common configurations among different files, or even different projects entirely. Extending services is ...
Read more >
Compose file version 3 reference - Docker Documentation
This table shows which Compose file versions support specific Docker releases. ... Top-level keys that define a section in the configuration file such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found