From a87677eb51474bc4c4a0fd32d318a1cb2c84dcb5 Mon Sep 17 00:00:00 2001 From: Alexander Hansson <90635063+AlexanderHansson4225@users.noreply.github.com> Date: Sun, 10 Dec 2023 14:47:43 +0100 Subject: [PATCH] Update README.md update readme to include a better description of deploymen --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 929a47c..de8d70e 100644 --- a/README.md +++ b/README.md @@ -321,9 +321,6 @@ port 80 being used... service nginx stop - - - # Update Database models The classes stored in the `Models` directory are the skeleton for the database. We use something called Code First to define our database structure in code relationships and then generate the database modifications automatically. @@ -373,4 +370,44 @@ cat name_of_migration.sql | docker exec -i name_of_db_container psql -U nexpo ``` +# Deploying and updating the Backend +The backend is currently hosted on AWS EC2 as three docker containers. Additionally, profile pictures and CVs are stored in AWS S3. + +## Updating the Database +There are several ways that the database can be updated. + +### Uploading via EC2 +The most straightforward one being simply doing it in the EC2 instance. Since the database is hosted in EC2, PostgreSQLcommands can be used to update the database. If you have found the database… good. If not, go to EC2 and enter + +```shell +docker exec -it bash +``` +```shell +psql -W nexpo -U nexpo +``` +* Enter the password + +### Uploading via python scripts +* In the folder ‘UploadToDB’ with a collection of python scripts and parsers that can be used to automate meticulous tasks. Note that some of them do not currently work, or work badly, as of IT22. (sorry) + + +## Updating the Backend +### Updating the backend endpoints +The backend currently running is available in Github at `/home/ec2-user/nexpo/nexpo-backend-nova` +It is updated by pulling the updated Github repo. The keys are (obviously) not in the Github repo, but should automatically be filled in. Make sure that this is the case. Also remember to migrate: + +```shell +dotnet ef migrations script +dotnet ef database update +``` + +Then update the containers: + +```shell +docker-compose -p nexpo build +docker-compose -p nexpo up -d +``` + +* This should create three docker containers (docker ps) +