wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.85k stars 1.19k forks source link

Deployment to bare metal #1481

Open infomiho opened 1 year ago

infomiho commented 1 year ago

We should write a piece about deploying Wasp to bare metal and/or with Docker container + docker-compose.yml

Using Caprover (self-hosted PaaS)

Deploy script ```bash #!/bin/bash set -e set -u set -o pipefail SERVER_APP=socialpostgpt-server CLIENT_APP=socialpostgpt-client CAPROVER_URL=https://captain.apps.twoducks.dev IS_BUILDING=false IS_DEPLOYING_SERVER=false IS_DEPLOYING_CLIENT=true if [ "$IS_BUILDING" = true ] ; then echo "Building server..." wasp build fi if [ ! -d ".wasp/build" ] ; then echo "Error: .wasp/build doesn't exist" exit 1 fi cd .wasp if [ "$IS_DEPLOYING_SERVER" = true ] ; then echo "Tar-ing server..." tar -czf server.tar.gz --exclude "node_modules" ./build/* echo "Deploying server..." caprover deploy -a $SERVER_APP -t ./server.tar.gz -u $CAPROVER_URL rm server.tar.gz fi if [ "$IS_DEPLOYING_CLIENT" = true ] ; then echo "Building client..." cd ./build/web-app REACT_APP_API_URL=https://$SERVER_APP.apps.twoducks.dev npm run build CLIENT_DOCKERFILE=$(cat < ./Dockerfile echo "!build" > .dockerignore echo "Tar-ing client..." tar -czf ../../client.tar.gz --exclude "node_modules" ./* echo "Deploying client..." caprover deploy -a $CLIENT_APP -t ../../client.tar.gz -u $CAPROVER_URL rm ../../client.tar.gz fi ```

docker-compose.yml

Writing a docker-compose.yml to run a built Wasp app should be pretty straightforward:

create-dan commented 1 year ago

Hey can you assign this to me ?

Martinsos commented 1 year ago

Hey @create-dan , sure go for it if you wish! Maybe it would be good if you presented here your plan on how you would like to approach this?

Martinsos commented 1 year ago

Related convo on Discord: https://discord.com/channels/686873244791210014/1159852795399249981/1159852795399249981 .

Martinsos commented 11 months ago

Another related convo on Discord, this one about running server without Docker but directly instead: https://discord.com/channels/686873244791210014/1171112746633400462/1171112746633400462 .

Martinsos commented 7 months ago

One more convo on Discord, also about running server without Docker: https://discord.com/channels/686873244791210014/1224779927505731605/1224779927505731605 .