Personal Culinary Blog of Elena Tsoy.
PLATFORM=amd docker compose -f dev.docker-compose.yml pull
rm db/PGSQL/.gitkeep
You need it to avoid a problem with Cold Run and Initialization of a new database (PSQL message: If you want to create a new database system, either remove or empty the directory
)
cd docker
docker compose -f dev.docker-compose.yml up psql
New initial PSQL database will be created in db/PGSQL
.
Restore the .gitkeep
that was removed recently.
From the root of the project.
touch db/PGSQL/.gitkeep
PSQL container has an access to the shared
folder in the root folder of the application.
We sould like to use this folder to share files across containers.
cd shared
scp [email protected]:/home/rails/DUMPS/eastflower.ru.2022_10_09_15_22.pq.sql .
Be sure that PSQL container is running, or restart it.
docker ps
!> eastflower-psql-1
eastflower-redis-1
eastflower-sphinx-1
eastflower-rails-1
docker exec eastflower-psql-1 bash /shared/create_eastflower_db.sh
!> eastflower-psql-1
eastflower-redis-1
eastflower-sphinx-1
eastflower-rails-1
docker exec eastflower-psql-1 bash -c "pg_restore -h localhost -d eastflower -U rails /shared/eastflower.ru.2022_10_09_15_22.pq.sql"
touch config/ENV/production/settings/app.yml
Add production settings.
PLATFORM=amd docker compose -f dev.docker-compose.yml up
!> eastflower-psql-1
!> eastflower-redis-1
!> eastflower-sphinx-1
!> eastflower-rails-1
docker exec -ti eastflower-rails-1 /bin/bash
$ cd home
$ RAILS_ENV=production rake ts:configure
docker compose -f dev.docker-compose.yml up
!> eastflower-psql-1
!> eastflower-redis-1
!> eastflower-sphinx-1
!> eastflower-rails-1
docker exec eastflower-sphinx-1 indexer --config /opt/sphinx/conf/sphinx.conf --all
docker compose -f dev.docker-compose.yml up
!> eastflower-psql-1
!> eastflower-redis-1
!> eastflower-sphinx-1
!> eastflower-rails-1
$ docker exec -ti eastflower-rails-1 /bin/bash
rails s -b 0.0.0.0 -p 3000
rsync -chavzPr [email protected]:/home/rails/eastflower.ru/public/uploads .
rsync -chavzPr [email protected]:/home/rails/eastflower.ru/public/uploads .
-c skip based on checksum, not mod-time & size
-h output numbers in a human-readable format
-a archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
-v increase verbosity
-z compress file data during the transfer
-P keep partially transferred files
-r recurse into directories
$ docker exec -ti eastflower-rails-1 /bin/bash
bundle exec puma -C config/_PUMA.production.rb