security of CI information with Docker Secrets |
(10-27-2020, 10:11 AM)richb201 Wrote: Thanks. So you are directly modifying the $dbconfig? Where are you doing this? I think you are doing this when building the Docker image. I am trying to use pre-existing Docker images and not build them myself. Any idea what CI module runs prior to the $dbconfig being used?I am doing this in the constructor in app/Config/Database.php The getenv() command gets information from the $_ENV or .env file - see http://codeigniter.com/user_guide/genera...ments.html I am not 100% sure when this file is running, but it happens every time the application is executed (remember PHP is an interpreted language - we have been experimenting with bootstrapping this when the docker launches but found that fragile using FARGATE) I don't change the code when building the Docker image, the code base is the same for all customers and managed through git. We just add a specific .env file suitable for the production environment (we use Bamboo to manage multiple customers and staging/production) and then upload the built image to the Registry. The .env-file handles username, passwords and API keys. The other part is the dynamic environment (databases hosts, filesystems, redis-caches etc) that we get from the docker task ENV. We also use the stock pre-existing image, but have a short Dockerfile to configure extensions etc. This is basically the file we use: Code: # Use an official PHP runtime as a parent image HtH /Mattias |
Messages In This Thread |
security of CI information with Docker Secrets - by richb201 - 10-27-2020, 05:55 AM
RE: security of CI information with Docker Secrets - by tgix - 10-27-2020, 09:49 AM
RE: security of CI information with Docker Secrets - by richb201 - 10-27-2020, 10:11 AM
RE: security of CI information with Docker Secrets - by tgix - 10-27-2020, 10:29 AM
RE: security of CI information with Docker Secrets - by richb201 - 10-27-2020, 12:50 PM
RE: security of CI information with Docker Secrets - by tgix - 10-27-2020, 12:55 PM
|