deep-foundation / deeplinks

https://discord.gg/deep-foundation
The Unlicense
14 stars 9 forks source link

Snapshot for production build #276

Open suenot opened 1 year ago

suenot commented 1 year ago

Is your feature request related to a problem? Please describe.

Command: npm run snapshot:create in package json run https://github.com/deep-tfoundation/deeplinks/blob/main/snapshots/create.js#L20 where:

execP(`cd docker-prod/deep && (docker-compose -f docker-compose.yml stop hasura postgres || true) && docker run -v ${_deeplinks}:/deeplinks --volumes-from deep-postgres --rm --name links --entrypoint \"sh\" deepf/deeplinks:main -c \"cd / && ls var/lib/postgresql && tar -c -v -C /var/lib/postgresql -f /deeplinks/snapshots/${time} ./data" && docker-compose -f docker-compose.yml start hasura postgres && cd ../.. && cp .migrate snapshots/${time}.migrate`);

Look at: run from docker-prod/deep.

But snapshots ofthen run in gitpod for local developement.

And I want to create snapshot for production. But production config is placed in local folder: /root/.nvm/versions/node/v18.18.2/lib/node_modules/@deep-foundation/deeplinks/local/docker-compose.yml

  1. Maybe create two different group of commands npm run snapshot:create/last for prod and local?
  2. Maybe need use local folder for local development and prod for production?
  3. Need snippet in cheat sheet about how to use snapshots not only in local development, but also in production.

Discussion in discord

Describe the solution you'd like

No response

Describe alternatives you've considered

No response