docs: custom apps with podman

This commit is contained in:
Revant Nandgaonkar
2025-01-06 17:47:10 +05:30
parent 869de6218b
commit acb08c5179
2 changed files with 72 additions and 60 deletions

View File

@@ -67,6 +67,7 @@ If you ran in a Dev Docker environment, to view container logs: `docker compose
### [Custom Images](#custom-images) ### [Custom Images](#custom-images)
- [Custom Apps](docs/custom-apps.md) - [Custom Apps](docs/custom-apps.md)
- [Custom Apps with podman](docs/custom-apps-podman.md)
- [Build Version 10 Images](docs/build-version-10-images.md) - [Build Version 10 Images](docs/build-version-10-images.md)
### [Development](#development) ### [Development](#development)

View File

@@ -1,4 +1,5 @@
## Prerequisites ## Prerequisites
- podman - podman
- podman-compose - podman-compose
- docker-compose - docker-compose
@@ -6,12 +7,15 @@
Podman (the POD MANager) is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers. It is available on the official repositories of many Linux distributions. Podman (the POD MANager) is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers. It is available on the official repositories of many Linux distributions.
## Step 1 ## Step 1
- Clone this repository and change the current directory to the downloaded folder - Clone this repository and change the current directory to the downloaded folder
```cmd ```cmd
git clone https://github.com/frappe/frappe_docker git clone https://github.com/frappe/frappe_docker
cd frappe_docker cd frappe_docker
``` ```
## Step 2 ## Step 2
- Create `apps.json` file with custom apps listed in it - Create `apps.json` file with custom apps listed in it
```json ```json
[ [
@@ -34,7 +38,9 @@ Podman (the POD MANager) is a tool for managing containers and images, volumes m
`cmd export APPS_JSON_BASE64=$(base64 -w 0 apps.json)` `cmd export APPS_JSON_BASE64=$(base64 -w 0 apps.json)`
## Step 3 ## Step 3
- Building the custom image using podman - Building the custom image using podman
```ruby ```ruby
podman build \ podman build \
--build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \ --build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \
@@ -43,10 +49,13 @@ Podman (the POD MANager) is a tool for managing containers and images, volumes m
--tag=custom:15 \ --tag=custom:15 \
--file=images/layered/Containerfile . --file=images/layered/Containerfile .
``` ```
### Note ### Note
- Make sure to use the same tag when you export a variable on the next step - Make sure to use the same tag when you export a variable on the next step
## Step 4 ## Step 4
- Using the image - Using the image
- Export environment variables with image name, tag and pull_policy - Export environment variables with image name, tag and pull_policy
```ruby ```ruby
@@ -55,9 +64,10 @@ Podman (the POD MANager) is a tool for managing containers and images, volumes m
export PULL_POLICY=never export PULL_POLICY=never
``` ```
- Configuration of parameters used when starting the containers - Configuration of parameters used when starting the containers
- create `.env` file copying from example.env (Read more on setting up environemnt variables [here](https://github.com/frappe/frappe_docker/blob/main/docs/environment-variables.md) - create `.env` file copying from example.env (Read more on setting up environment variables [here](https://github.com/frappe/frappe_docker/blob/main/docs/environment-variables.md)
## Final step ## Final step
- Creating a compose file - Creating a compose file
- ```ruby - ```ruby
podman compose -f compose.yaml \ podman compose -f compose.yaml \
@@ -72,20 +82,21 @@ Podman (the POD MANager) is a tool for managing containers and images, volumes m
- `podman-compose --in-pod=1 --project-name erpnext -f ./docker-compose.yml up -d` - `podman-compose --in-pod=1 --project-name erpnext -f ./docker-compose.yml up -d`
## Creating sites and installing apps ## Creating sites and installing apps
- You can create sites from the backend container - You can create sites from the backend container
- `podman exec -ti erpnext_backend_1 /bin/bash` - `podman exec -ti erpnext_backend_1 /bin/bash`
- `bench new-site myerp.net --mariadb-root-password 123456 --admin-password 123123` - `bench new-site myerp.net --mariadb-root-password 123456 --admin-password 123123`
- `bench --site myerp.net install-app erpnext` - `bench --site myerp.net install-app erpnext`
## Troubleshoot ## Troubleshoot
- If there is a network issue while building the image, you need to remove caches and restart again - If there is a network issue while building the image, you need to remove caches and restart again
- `podman system reset` - `podman system reset`
- `sudo rm -rf ~/.local/share/containers/ /var/lib/container ~/.caches/containers` - `sudo rm -rf ~/.local/share/containers/ /var/lib/container ~/.caches/containers`
- Database issue when restarting the container - Database issue when restarting the container
- Execute the following commands from **backend** container - Execute the following commands from **backend** container
- `mysql -uroot -padmin -hdb` (Note: put your db password in place of *admin*). - `mysql -uroot -padmin -hdb` (Note: put your db password in place of _admin_).
- `SELECT User, Host FROM mysql.user;` - `SELECT User, Host FROM mysql.user;`
- Change the IP address to %, e.g. `RENAME USER '_5e5899d8398b5f7b'@'172.18.0.7' TO '_5e5899d8398b5f7b'@'%'` - Change the IP address to %, e.g. `RENAME USER '_5e5899d8398b5f7b'@'172.18.0.7' TO '_5e5899d8398b5f7b'@'%'`