-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
23 lines (17 loc) · 857 Bytes
/
deploy.sh
File metadata and controls
23 lines (17 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Secrets
DOMAIN=""
KEYSTORE_PASS=""
OPENAI_API_KEY=""
# Step 1 - Copy firebase_credentials.json file
cp firebase_credentials.json source-code/src/main/java/edu/brown/cs/student/main/server/config/
# Step 2 - Make temp file with keystore password
(echo $KEYSTORE_PASS) > /tmp/keystore_TEMP.txt
# Step 3 - Build syntax-backend Docker container
sudo docker buildx build --secret id=cert_fullchain,src=/etc/letsencrypt/live/$DOMAIN/fullchain.pem \
--secret id=cert_privkey,src=/etc/letsencrypt/live/$DOMAIN/privkey.pem \
--secret id=keystore_pass,src=/tmp/keystore_TEMP.txt -t syntax-backend .
# Step 4 - Delete temporary keystore file
rm /tmp/keystore_TEMP.txt
# Step 5 - Run the Docker container
sudo docker run -e KEYSTORE_PASS=$KEYSTORE_PASS -e OPENAI_API_KEY=$OPENAI_API_KEY -p 443:443 syntax-backend