sbt flywayMigrate
sbt flywayFixtures
Ensure your app is production-ready. Update conf/application.conf for production settings (e.g., database URLs, ports).
- Run awsume to switch to the desired AWS profile
awsume kane- Verify the active profile with:
awsume --whopython -m pip install awsebcli- Ensure sbt dist generates target/universal/cooking-1.0-SNAPSHOT.zip.
- Unzip, add the Procfile, and re-zip:
sbt dist
unzip target/universal/cooking-1.0-SNAPSHOT.zip -d .
cd cooking-1.0-SNAPSHOT
echo 'web: /var/app/current/bin/cooking -Dconfig.file=/var/app/current/conf/application.conf' > Procfile
zip -r ../cooking-1.0-SNAPSHOT.zip .
cd ../
mv cooking-1.0-SNAPSHOT.zip target/universal/
rm -rf cooking-1.0-SNAPSHOTGenerate a secure secret key:
sbt playGenerateSecreteb init -p "arn:aws:elasticbeanstalk:us-east-1::platform/Corretto 11 running on 64bit Amazon Linux 2023/4.5.2" cooking-app --region us-east-1- Create a single-instance t2.micro environment (Free Tier-compliant):
eb create cooking-env --single --instance_type t2.micro --keyname cooking-key- After eb create but before eb deploy (or during eb create if deploying simultaneously):
eb setenv PLAY_HTTP_SECRET_KEY="BN\`g/7Oh6x^eFgrTclearYJFbhMhs9rGLAg@IbhB[<u?Z[Q0i][ElA6>04[ap>]VDh4;U"eb deployeb logseb terminate cooking-envsudo systemctl status web.service
sudo systemctl edit --full web.serviceeb ssh/bin/sh -c /var/app/current/bin/cooking -Dplay.http.secret.key="BN\`g/7Oh6x^eFgrTclearYJFbhMhs9rGLAg@IbhB[<u?Z[Q0i]
[ElA6>04[ap>]VDh4;U" -Dhttp.port=5000 -Dconfig.file=/var/app/current/conf/application.conf -Xmx512m -Xms256m
sudo -u webapp /bin/sh -c /var/app/current/bin/cooking -Dconfig.file=/var/app/current/conf/application.conf -Xmx512m -Xms256m
/bin/sh -c /var/app/current/bin/cooking -Dconfig.file=/var/app/current/conf/application.conf -Xmx512m -Xms256m