aquariumbio / aquarium

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

V3 production docker #616

Closed bjkeller closed 3 years ago

bjkeller commented 3 years ago

Adds configuration for running v3 Aquarium in production using Docker Compose.

  1. Include modifications to run backend in production adding: build and production stages to backend/Dockerfile; a production entrypoint; and the license file. Also disables dns rebinding guard for production since is running behind nginx. Adds configuration to allow running database migration service.
  2. Includes changes to run frontend in production with build and production stages in frontend/Dockerfile; and an nginx configuration file to serve the frontend pages
  3. Adds an nginx directory to build an image for proxy service with basic configuration to route api to backend and other request to frontend.
  4. Adds SQL script to create production database and grant access to backend user.
  5. Includes helper script and compose file to run production.

Fixes #596 Fixes #592 Fixes #612

gnomicosuw commented 3 years ago

I ran the following three times with the same results each time:

  1. clean my system docker-compose down -v (this also removes aquarium_react_db_data) rm .env rm -rf .env_files

  2. start up production ./bin/setup.sh ./bin/production.sh build ./bin/production.sh up

result A:

I get "aquarium_react_db-migrator_1 exited with code 0" in the log, but that does not appear to affect the system

result B:

the db comes up but it does not have seed data

  1. seed the database docker-compose exec backend env RAILS_ENV=production rails db:seed

  2. run the app go to localhost (or localhost:80) try to login with neptune / aquarium123

result:

get an error, but it appears NO request is being sent: NOTHING hits the production log (you would expect to see a "POST" to the backend...) NOTHING happens in the inspector (you would expect to see activity in the "network" tab...)

bjkeller commented 3 years ago

OK, the nginx configuration is minimal, so could be that the api isn't exposed properly for the frontend.

These should be expected:

bjkeller commented 3 years ago

I'm going to close this for now