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.sh
make 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.yml
toconfiguration.yml
and change the config - Run
./scripts/env.sh > .env
- Run
docker compose up -d
- Run
./scripts/apply.sh
- Run
nix run .#dev
this 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
jq
andyj
- Copy
configuration.example.yml
toconfiguration.yml
and change the config - Run
./scripts/env.sh > .env
- Run
docker compose up -d
- Run
./scripts/apply.sh
- Run
RUST_LOG=info cargo run
this 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.json
to
{
"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
groups
and 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.conf
to large number like65536
and addfs.file-max = 65536
to/etc/sysctl.conf
file.
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.yml
toconfiguration.yml
and change theconfiguration.yml
application.bodylimit
to 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.example
inui
folder to.env
and change theVITE_API_URL
to the server ip. - Run
./scripts/env.sh > .env
to generate the environment variable. - Run
docker compose up -d
to 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].wsgi
and 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-ui
folder. - Run
pnpm install
. - Run
pnpm start
to start the docusaurus. - Add folder in
docs
folder to add new documentation. - Access the docusaurus in
localhost:4000
to access the documentation. - To deploy use docker compose by running
docker compose up docs -d
or it also run on defaultdocker compose up -d
to deploy all service. - The docs will be available in
docs.[domain]
domain. The domain is configured in theconfiguration.yml
file.