Skip to content

Changes in the Dockerfile and files for each environment added:#4

Open
agpenton wants to merge 1 commit intogeosolutions-it:C207-OSMfrom
agpenton:C207-OSM-ENV
Open

Changes in the Dockerfile and files for each environment added:#4
agpenton wants to merge 1 commit intogeosolutions-it:C207-OSMfrom
agpenton:C207-OSM-ENV

Conversation

@agpenton
Copy link

  • build-args "P_ENV" added for conditional ENV.
  • postgresql.dev.conf for DEV environment added.
  • postgresql.prod.conf for PROD environment added.
    all above resolve geosolutions-it/C207-OSM#20

- build-args "P_ENV" added for conditional ENV.
- postgresql.dev.conf for DEV environment added.
- postgresql.prod.conf for PROD environment added.
@agpenton agpenton added the enhancement New feature or request label Mar 22, 2021
@agpenton agpenton requested a review from randomorder March 22, 2021 18:21
Copy link
Member

@randomorder randomorder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not documented anywhere?

Can't we just bind-mount the configuration file at run time?

@agpenton
Copy link
Author

agpenton commented Mar 26, 2021

This is not documented anywhere?

It's not documented but is in the Makefile, I will update the README.md to add this as a note in the PostgreSQL step.

Can't we just bind-mount the configuration file at run time?

The problem with just mount is that every time that you want to run one of the environment you will need to change the file in the docker-compose.yml and add a command to the service specifying where is the config file, in this way you just build the image for the environment that you need, and another point is that with the PostgreSQL when initializing the database if the command for the config file doesn't exist will ignore it.

@randomorder
Copy link
Member

This is not documented anywhere?

It's not documented but is in the Makefile, I will update the README.md to add this as a note in the PostgreSQL step.

Fix it then

Can't we just bind-mount the configuration file at run time?

The problem with just mount is that every time that you want to run one of the environment you will need to change the file in the docker-compose.yml and add a command to the service specifying where is the config file

No because each env has it's own file in the same location..

in this way you just build the image for the environment that you need, and another point is that with the PostgreSQL when initializing the database if the command for the config file doesn't exist will ignore it.

Please explain., I do not understand

@agpenton
Copy link
Author

agpenton commented Mar 29, 2021

This is not documented anywhere?

It's not documented but is in the Makefile, I will update the README.md to add this as a note in the PostgreSQL step.

Fix it then

The PR for the documentation is https://github.com/geosolutions-it/C207-OSM/pull/22

Can't we just bind-mount the configuration file at run time?

The problem with just mount is that every time that you want to run one of the environment you will need to change the file in the docker-compose.yml and add a command to the service specifying where is the config file

No because each env has its own file in the same location...

if you want to have two directories that each contain one environment, then ok.

in this way you just build the image for the environment that you need, and another point is that with PostgreSQL when initializing the database if the command for the config file doesn't exist will ignore it.

Please explain., I do not understand

For example, if you mount the postgresql.conf file to the default path, when the Postgres initialize the database and see that have data in the volume, will skip the initialization because the directory is not empty. So you will have to mount the file to another location, and add a command to the PostgreSQL service, ex: command: postgres -c config_file=/etc/postgresql.conf, but If you need to run multiple commands in that service, then you will need to change it. So to avoid that, I wrote the Dockerfile to build with the file that corresponds with the environment that you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants