PaaS (Platform as a Service) to help sustain application deployment in Fasilkom UI.
Make sure your user has docker access by running groups and check if docker is in it. If not run sudo usermod -aG docker $USER newgrp docker or run the app with sudo.
- Run
./script/install-nix.shmake sure not using root but the user have root privileges - Close terminal and open it again to get new session
- Run
direnv allow - Copy
configuration.example.ymltoconfiguration.ymland change the config - Run
./scripts/env.sh > .env - Run
docker compose up -d - Run
./scripts/apply.sh - Run
nix run .#devthis will talke a while
- Install rust via rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - Install tool by running
./scripts/install-tools.sh - Install
jqandyj - Copy
configuration.example.ymltoconfiguration.ymland change the config - Run
./scripts/env.sh > .env - Run
docker compose up -d - Run
./scripts/apply.sh - Run
RUST_LOG=info cargo runthis will talke a while
After writing code. Before commit, run cargo sqlx prepare. To do that automatically you can enable the git hook by running ln -sf ../../scripts/pre-commit ./.git/hooks
- Prerequisite knowledge. need to know docker, linux admin, caddy well. docker knowledge including debugging docker runtime and navigating with the cli. linux administration used for debugging if the storage ran out, increasing the file open limits. caddy to debug the reverse proxy.
- Make sure docker is installed. The server uses docker build to build the image and to run the image.
- Change the docker daemon file in
/etc/docker/daemon.jsonto
{
"metrics-addr": "127.0.0.1:9323",
"bip": "172.32.0.1/12",
"default-address-pools": [
{
"base": "172.17.0.0/12",
"size": 24
},
{
"base": "192.168.0.0/16",
"size": 24
}
]
}to make sure the project won't ran out of ip. This is important for deploying a lot of project since the default settings only give you 31 networks.
- Make sure the user have docker group access by running
groupsand check if docker is in it. If not runsudo usermod -aG docker $USER && newgrp docker. The application uses docker API to access the docker daemon. Make sure the user have access to the docker daemon. - Increase the file open limit size in
/etc/security/limits.confto large number like65536and addfs.file-max = 65536to/etc/sysctl.conffile.
This is important to make sure the server can handle a lot of file open at the same time when deploying a lot of project. - Copy
configuration.example.ymltoconfiguration.ymland change theconfiguration.ymlapplication.bodylimitto large value like 500mb or 1gb to allow large file upload. The bodylimit is important to mitigate git errorunexpected disconnect while reading sideband packet. - Copy
.env.exampleinuifolder to.envand change theVITE_API_URLto the server ip. - Run
./scripts/env.sh > .envto generate the environment variable. - Run
docker compose up -dto start the server. This will take a while.
- If the deployment can't run, add procfile to the root of the project. For django its
release: python manage.py collectstatic --noinput && python manage.py migrate --noinput
web: gunicorn [project_name].wsgiand make sure have gunicorn in the requirements.txt file.
- Make sure to push branch is master to deploy to the server since the server checks only the master branch.
- Install nodejs and pnpm.
- Go to
docs-uifolder. - Run
pnpm install. - Run
pnpm startto start the docusaurus. - Add folder in
docsfolder to add new documentation. - Access the docusaurus in
localhost:4000to access the documentation. - To deploy use docker compose by running
docker compose up docs -dor it also run on defaultdocker compose up -dto deploy all service. - The docs will be available in
docs.[domain]domain. The domain is configured in theconfiguration.ymlfile.