-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deploy): prod deployment and devops setup
- Loading branch information
Tom JEANNESSON
committed
Jan 5, 2024
1 parent
7e8d594
commit 5b3d52d
Showing
33 changed files
with
245 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
DB_SETUP=litestream | ||
LITESTREAM_ACCESS_KEY_ID=minioadmin | ||
LITESTREAM_SECRET_ACCESS_KEY=minioadmin | ||
S3_BUCKET_PATH=s3://miniobkt.localhost:9000/db.sqlite3 | ||
S3_BUCKET_PATH=s3://miniobkt.localhost:9000/db.sqlite3 | ||
DB_SETUP="litestream" | ||
DB_ENGINE="SQLITE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
DB_SETUP=litestream | ||
LITESTREAM_ACCESS_KEY_ID="" # TODO : Generate random password | ||
LITESTREAM_SECRET_ACCESS_KEY="" # TODO : Generate random password | ||
S3_BUCKET_PATH="" # TODO : Create s3 bucket | ||
# General secrets | ||
# ------------------------------------------------------------------------------ | ||
DB_SETUP="litestream" | ||
DB_ENGINE="SQLITE" | ||
|
||
# To fill in in JS | ||
# ------------------------------------------------------------------------------ | ||
# AWS_ACCESS_KEY_ID="" # TODO : Get IAM credentials | ||
# AWS_SECRET_ACCESS_KEY="" # TODO : Get IAM credentials | ||
# AWS_S3_BUCKET_URI="" # TODO : Get s3 bucket path | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
SECRET_KEY = "secret-key" # noqa: S105 | ||
41 changes: 41 additions & 0 deletions
41
backend/deploy/aws/.ebextensions/01_CloudWatch_Avg_Mem.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
files: | ||
"/opt/aws/amazon-cloudwatch-agent/bin/config.json": | ||
mode: "000600" | ||
owner: root | ||
group: root | ||
content: | | ||
{ | ||
"metrics":{ | ||
"metrics_collected":{ | ||
"mem":{ | ||
"measurement":[ | ||
"mem_used_percent" | ||
], | ||
"metrics_collection_interval":60 | ||
} | ||
}, | ||
"append_dimensions": { | ||
"InstanceId": "${aws:InstanceId}" | ||
} | ||
} | ||
} | ||
container_commands: | ||
start_cloudwatch_agent: | ||
command: /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s | ||
create_alarm: | ||
command: | | ||
InstanceId=$(ec2-metadata -i) | ||
InstanceId=${InstanceId:13} | ||
aws cloudwatch put-metric-alarm \ | ||
--alarm-name 'MemoryUtilization' \ | ||
--alarm-description 'Alarm when server Memory exceeds 80 percent' \ | ||
--metric-name mem_used_percent \ | ||
--namespace CWAgent \ | ||
--statistic Average \ | ||
--period 60 \ | ||
--threshold 80 \ | ||
--comparison-operator GreaterThanThreshold \ | ||
--dimensions Name=InstanceId,Value=$InstanceId \ | ||
--evaluation-periods 1 \ | ||
--alarm-actions arn:aws:swf:eu-west-3:073501479403:action/actions/AWS_EC2.InstanceId.Reboot/1.0 \ | ||
--unit Percent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
backend/docker/compose/development/postgres/maintenance/_sourced/constants.sh
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
backend/docker/compose/development/postgres/maintenance/_sourced/countdown.sh
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
backend/docker/compose/development/postgres/maintenance/_sourced/messages.sh
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
backend/docker/compose/development/postgres/maintenance/_sourced/yes_no.sh
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
backend/docker/compose/development/postgres/maintenance/backup
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
backend/docker/compose/development/postgres/maintenance/backups
This file was deleted.
Oops, something went wrong.
55 changes: 0 additions & 55 deletions
55
backend/docker/compose/development/postgres/maintenance/restore
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.