NEED HELP for dockerizing custom configurations

Hello,
Im new to docker and dont know much about frappe as well

I have created a project using the existing apps such as frappe, erpnext, hrms
but i made changes in those apps itself like adding doctype, creating endpoints in api level

how to create docker for this!
Please help

Create a Dockerfile in your project directory. This file will define how your Docker image is built. Here’s a basic example:

Dockerfile

# Use an official Python runtime as a parent image
FROM frappe/erpnext-worker:edge

# Set the working directory in the container
WORKDIR /home/frappe/frappe-bench

# Copy your custom app(s) into the container
COPY ./custom_apps/* /home/frappe/frappe-bench/apps/

# Install any additional dependencies if needed
# For example, if you have custom requirements for your app
# RUN pip install -r requirements.txt

# Set permissions (adjust as necessary)
RUN chown -R frappe:frappe /home/frappe/frappe-bench/apps/*

# Expose ports (if necessary)
# EXPOSE 80

# Start the services
CMD ["bench", "start"]

2. Directory Structure

Make sure your project directory structure looks something like this:

project-directory/
│
├── Dockerfile
├── custom_apps/
│   ├── frappe/
│   ├── erpnext/
│   ├── hrms/
│   └── your_custom_app/   # Include your customizations here
│       ├── hooks.py
│       ├── patches.txt
│       └── ...
│
└── ...
3. Build the Docker Image

Navigate to your project directory in the terminal and build your Docker image using the docker build command:

docker build -t my-custom-erpnext .

Replace my-custom-erpnext with a suitable name for your Docker image.

4. Run the Docker Container

Once the image is built, you can run a container based on that image:

docker run -d -p 8000:8000 my-custom-erpnext

This command runs a container in detached mode (-d) and maps port 8000 of your container to port 8000 of your host system (-p 8000:8000).

I didnt create a custom app, i customised the existing apps
frappe, erpnext and hrms

The doctype and fields of the doctype as well

If i follow regular method of dockerisation i wont get these changes in it, I dont know how to add these changes during Dokerisation

Oh, I guess you made some changes to the inbuilt frappe, hrms , erpnext apps and now you want to see the changes live on your server, but you don’t know how to integrate these ?
please correct me if I’m wrong.

Yes! Exactly

For that you need to save the settings/changes which you have done to the apps.

and then reload the site by these commands.

bench build or bench build --force

bench restart

also after these check/set

bench --site yoursitename set-maintenance-mode off

These all commands helped me earlier when i made the changes.
I was using Ubuntu 22.

for me only the Build command helped without any issue.

I did the changes in my built in apps which is in my local system, now i want to make a docker image out of it so that itll be easier if i run it in another system
To create that I dont know how to do it

If i follow this frappe_docker/docs/custom-apps.md at main · frappe/frappe_docker · GitHub
It wont include the changes done in the built in apps, so is there any other way out

for that you need to create a docker file.

as i mentioned above.

@sneha
He @revant_one is the master of Docker, he may help you with this.

Thank You

I asked him as well, got the same link recomendation which i followed

I’ll try once again
Thanks

Welcome, and yes you need to check the link and other sources, basically you need to dockerize the file (create docker image ) of the changes you made. and then you can add to other system while configuration.

Can u explain a bit more about this
Im confused about what to do exactly

@sneha

did you solve it?, i had the same problem :((

No, I couldn’t install the apps from my private repository in which i did changes
So finally now doing fresh installation and creating the new erpnext with hrms where im redoing the whole changes again
and also I switched from version 14 to 15 as there was lots of issues to install this version
This is only my experience dont generalise it
I might have made some mistakes unaware of the process

@sneha finally, you install without docker image inbuild frappe ?

No i installed erpnext in docker itself, but the changes that i made in erpnext which i installed in my local system( no docker), I couldnt reflect it in the docker installation

it mean the custom code you make in development container not implement in docker image when use build

@sneha