#1358  Docker Compose
Closed
Filip Strajnar opened 1 year ago

I was told to contribute on this repository instead of GitHub, so I decided to open an issue here. I will modify the docker compose script to use postgres, but I'd also want to ask if the following idea is good: I propose I'd make a top level directory called docker, in which there would be a setup.py and setup.sh file, which would generate a secure random password (for example openssl rand -hex 32) for both admin user, and the database. It would effectively render a docker-compose.yaml file that's already reasonably secure to deploy. This way there would be no need for those extra comments within docker-compose.yaml file. If this suggestion is bad, or if there is a better way to go about it, let me know.

Robin Shen commented 1 year ago

I plan to move docker-compose.yaml into https://code.onedev.io/onedev/server/~files/main/server-product/docker, and this file will be published together with other artifacts like this: https://code.onedev.io/onedev/server/~builds/3602/artifacts

However I do not think there is much value for separate setup.py/setup.sh whose purpose is only to generate password for database and OneDev administrator, which adds complexities (you need to write docs for it to tell user what it is...). For database password, if we do not open the 3306 port, it should be fine to use a default password, and for OneDev adminsitrator, you may comment out various initial environments, and OneDev will prompt user to input password when it starts up for the first time. Also I think it is easier to modify docker-compose.yaml if you want to change it. They can use any password they want.

Robin Shen commented 1 year ago

docker-compose.yaml has now been moved to directory server-product/docker with some modifications:

  1. Use expose instead of ports for postgresql service port to make it only accessible from within other containers.
  2. Use ./docker/site/postgres instead of ./postgres to store postgresql database so that we only need one external data directory
  3. Make container onedev depends on postgres to ganrantee correct container startup order
Robin Shen changed state to 'Closed' 12 months ago
Previous Value Current Value
Open
Closed
issue 1 of 1
Type
Improvement
Priority
Minor
Assignee
Issue Votes (0)
Watchers (3)
Reference
onedev/server#1358
Please wait...
Page is in error, reload to recover