Verified Commit 59165008 authored by Florent Chehab's avatar Florent Chehab
Browse files

docs(general): reorganized / split

parent 58473deb
......@@ -7,7 +7,7 @@ You have to options to initialize data in the app:
## From a production database backup
If you have access to [a production database backup](Application/deploy?id=creating-a-database-dump), follow these instructions:
If you have access to [a production database backup](ProdRelated/dump_database), follow these instructions:
- Download the dump, and move it to the location: `/tmp/rex-dri.dump.gpg`
- decrypt it (**You will need a passphrase for this.**):
......
# How to deploy
## Step-by-step
Deploying the app is fairly simple: all you need is `docker` and `docker-compose` installed.
If you don't know how to install them, you should look in [this section](GettingStarted/set-up.md) of the documentation.
- Once this is done clone the repository of the project.
- Then, run `make setup` (this will generate the required `.env` files) and set their correct values in both `server/envs` directory and `.env` (at the root of the repo -- for the map to work appropriately). Take care especially with the files `django.env` and `external_data.env`.
- Once this is done, you can simply run `make prod` and then `make init_dev_data` (TODO create one for prod) to get going fast.
`make prod` will start all the services described in `docker-compose.prod.yml` (in the `server` directory).
## Production architecture
# Production architecture
Bellow is a quick nasty schema of the deploy architecture:
......@@ -30,32 +16,3 @@ The important stuff to remember:
- All logs are handled through docker volumes and a dedicated service that rotate the logs each day and keep 30 rotations (/days) of logs.
All request coming in `nginx` are logged. backend server errors are logged. If a frontend crash occurs a logging request is sent to the backend that will log it in a dedicated file.
## Creating a database dump
To create a backup of the production database follow these instructions:
- SSH to the REX-DRI VM @UTC, then
```bash
rm -rf /tmp/rex-dri.*
sudo docker exec server_database_1 bash -c 'pg_dump -Fc --no-owner -d postgres -U postgres > /tmp/rex-dri.dump'
sudo docker cp server_database_1:/tmp/rex-dri.dump /tmp/rex-dri.dump
sudo chown $(whoami):$(whoami) /tmp/rex-dri.dump
# Encrypt the database dump
cd /tmp
GPG_TTY=$(tty) gpg-zip -c -o rex-dri.dump.gpg rex-dri.dump
```
- Copy the encrypted dump to your computer:
```bash
rm -rf /tmp/rex-dri.*
scp user@rex-dri-host:/tmp/rex-dri.dump.gpg /tmp/rex-dri.dump.gpg
```
The dump will be available on your computer at location `/tmp/rex-dri.dump.gpg`.
:warning: **Never share the decrypted version of the dump.**
# Creating a database dump
To create a backup of the production database follow these instructions:
- SSH to the REX-DRI VM @UTC, then
```bash
rm -rf /tmp/rex-dri.*
sudo docker exec server_database_1 bash -c 'pg_dump -Fc --no-owner -d postgres -U postgres > /tmp/rex-dri.dump'
sudo docker cp server_database_1:/tmp/rex-dri.dump /tmp/rex-dri.dump
sudo chown $(whoami):$(whoami) /tmp/rex-dri.dump
# Encrypt the database dump
cd /tmp
GPG_TTY=$(tty) gpg-zip -c -o rex-dri.dump.gpg rex-dri.dump
```
- Copy the encrypted dump to your computer:
```bash
rm -rf /tmp/rex-dri.*
scp user@rex-dri-host:/tmp/rex-dri.dump.gpg /tmp/rex-dri.dump.gpg
```
The dump will be available on your computer at location `/tmp/rex-dri.dump.gpg`.
:warning: **Never share the decrypted version of the dump.**
......@@ -86,8 +86,3 @@ _Goto to http://localhost:8000/, and check you need to aggree to the cgu / gdpr
- [ ] Check you can edit your personal information
- [ ] Check you can delete your account
- [ ] Check logout works correctly
## Post deployment
- [ ] Make sure auto-update works the next day
- [ ] Check `/app/my/exchanges/` reload button is working
......@@ -30,11 +30,17 @@
- [Map](Application/Frontend/map.md)
- [Troubleshooting](Application/Frontend/troubleshooting.md)
* Prod related
- Going in prod
- [Feature checklist](Application/feature_checklist.md)
- [Deploy](Application/deploy.md)
- Comments about technologies used
- [Feature checklist](ProdRelated/feature_checklist.md)
- [Releasing](ProdRelated/releasing.md)
- [Architecture](ProdRelated/architecture.md)
- [Dump database](ProdRelated/dump_database.md)
* Comments about technologies used
- [Use of `Docker`](Technologies/docker.md)
- [Debugger](Technologies/debugging.md)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment