aquariumbio / aquarium

The Aquarium Lab Operating System
http://klavinslab.org/aquaverse/
MIT License
58 stars 15 forks source link

V3 docker revisions #478

Closed bjkeller closed 3 years ago

bjkeller commented 3 years ago

This branch is a revamp of the docker-configuration inherited from Aquarium v2.8.

Specifically,

  1. Changes configuration to focus on the development environment and the current state of the code. So, removes nginx and MinIO services, cleans MinIO required ip table manipulation from backend entrypoint script, simplifies the backend Dockerfile, and removes production-specific files.
  2. Replaces use of .env file with explicit use of env_files in docker-compose files, and .env is now a directory with files organized by Rails environment. More details in the documentation
  3. Updates setup.sh to create this directory structure. Adds scripts to manage swapping databases (changing name in settings, and making a dump of active database). All developer scripts are in the bin directory.
  4. Adds environment variables allowing the external ports of the backend, db, and frontend services to be set via the env files.
  5. Changes how the database files are managed to use a named Docker volume. Removes the data/db directories. This also means using the -v option on docker-compose down will remove the database files.
  6. Changes mysql service volume configuration to mount the docker/mysql_init directory rather than a single dump file. This allows for multiple dump files to be loaded from the directory.
  7. Updates the developer documentation
bjkeller commented 3 years ago

Just to emphasize the point, with this configuration, if you use the -v option with docker-compose down it will blow away the database files. It eliminates the need to manage the files on disk, which is a pain with the current configuration, but obviously there is a tradeoff.

gnomicosuw commented 3 years ago

Looks great! I updated the "default.sql" file and added the "create_aquarium_test.sql" file.

marikoja commented 3 years ago

@bjkeller I was able to get everything up and running so that is great. The one thing I that would be helpful is instructions or a script so you could use an existing db dump. I was was able to import the db dump I use from nursery via a db GUI but following the documentation to copy the file over did not work.

bjkeller commented 3 years ago

@gnomicosuw I changed the SQL privileges command to match what I had, and it works. Not sure what the detailed issue was.

bjkeller commented 3 years ago

@marikoja there was a bad path in the scripts. I also revised the instructions for switching databases, and added a script that will load a sql file to the database