- Get the bun.
cd frontend
and then:bun i && bun run build
to build the frontend part.nohup bun run start --port 3001 > bun.log 2>&1 &
to start the frontend server.
cd backend
and then:cp .env.example .env
and edit it.bun i
../ctl.ts dev run-postgres-in-docker
to run the database../ctl.ts dev deploy-db-migrate
to apply those database migrations.nohup bun run serve > bun.log 2>&1 &
to start the backend server.
Then you need a proxy to serve the static files (built from frontend) and the backend. Here is an example of Caddyfile:
homesite.peterlits.com {
handle /api/v1/* {
reverse_proxy localhost:3000
}
handle {
reverse_proxy localhost:3001
}
}
$ docker build -t homesite .
# Remove the flag about host network
$ docker run --net host --env-file=<your-env-file> homesite