-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ssh_key_name = "some_key" | ||
|
||
SERVER__JWT_SECRET_KEY = "very_long_secret_key" | ||
SPOTIFY_CLIENT_ID="changeme" | ||
SPOTIFY_CLIENT_SECRET="supersecret" | ||
|
||
DB__MONGO_USER = "root" | ||
DB__MONGO_PASSWORD = "password" |
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,29 +1,37 @@ | ||
#!/bin/bash | ||
set -e | ||
set -e # Exit if a command yields a non-zero exit code | ||
|
||
# Update yum and install Docker onto the EC2 server | ||
sudo yum update -y | ||
sudo yum install -y docker | ||
|
||
# Start up Docker | ||
sudo service docker start | ||
sudo chkconfig docker on # auto restart docker | ||
|
||
# sudo systemctl enable docker.service | ||
# sudo systemctl start docker.service | ||
|
||
# Install Docker Compose | ||
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose | ||
sudo chmod +x /usr/local/bin/docker-compose | ||
|
||
sudo usermod -aG docker ec2-user # Add user to "docker" group for permissions | ||
|
||
# cd ~ | ||
|
||
# Install git | ||
sudo yum install -y git | ||
git clone https://github.com/ufosc/Jukebox-Server.git /home/ec2-user/Jukebox-Server | ||
|
||
# Jukebox-Server Configuration ======================== | ||
git clone https://github.com/ufosc/Jukebox-Server.git /home/ec2-user/Jukebox-Server | ||
echo "# Environment Variables, created by terraform on $(date)" > /home/ec2-user/Jukebox-Server/.env | ||
|
||
%{ for env_key, env_value in env } | ||
echo "${env_key}=${env_value}" >> /home/ec2-user/Jukebox-Server/.env | ||
%{ endfor ~} | ||
|
||
|
||
sudo docker-compose -f /home/ec2-user/Jukebox-Server/docker-compose.prod.yml up -d --build | ||
|
||
# Jukebox-Frontend Configuration ====================== | ||
git clone https://github.com/ufosc/Jukebox-Frontend.git /home/ec2-user/Jukebox-Frontend | ||
sudo docker-compose -f /home/ec2-user/Jukebox-Frontend/docker-compose.network.yml run --rm client sh -c "npm run build" --build | ||
|
||
|
||
|
||
|
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