diff --git a/docker-compose.yml b/docker-compose.yml index 9e694a9c..6d028617 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,9 @@ services: api: &api image: jhumanj/opnform-api:latest + build: + context: . + dockerfile: docker/Dockerfile.api environment: &api-environment # Add this anchor DB_HOST: db REDIS_HOST: redis @@ -18,6 +21,9 @@ services: api-worker: image: jhumanj/opnform-api:latest + build: + context: . + dockerfile: docker/Dockerfile.api command: php artisan queue:work environment: <<: *api-environment @@ -29,6 +35,9 @@ services: ui: image: jhumanj/opnform-client:latest + build: + context: . + dockerfile: docker/Dockerfile.client env_file: - ./client/.env diff --git a/docs/deployment/docker.mdx b/docs/deployment/docker.mdx index 288afa3f..d90de9cd 100644 --- a/docs/deployment/docker.mdx +++ b/docs/deployment/docker.mdx @@ -67,7 +67,25 @@ We recommend using these official images for your OpnForm deployment. ## Building Your Own Docker Images -If you prefer to build your own Docker images, you can do so using the provided Dockerfiles in the repository: +By default, OpnForm uses pre-built images from Docker Hub. However, if you want to build the images yourself (for development or customization), you have two options: + +### Option 1: Using Docker Compose (Recommended) + +The simplest way to build the images is using Docker Compose: + +```bash +docker compose build +``` + +This will build all the necessary images. You can then start the application as usual: + +```bash +docker compose up -d +``` + +### Option 2: Building Images Manually + +You can also build the images manually using the provided Dockerfiles: 1. Build the API image: ```bash @@ -79,6 +97,8 @@ If you prefer to build your own Docker images, you can do so using the provided docker build -t opnform-ui:local -f docker/Dockerfile.client . ``` +If you build the images manually, make sure to update your docker-compose.override.yml to use these local images (see below). + ### Overriding Docker Compose Configuration You can override the default Docker Compose configuration by creating a `docker-compose.override.yml` file. This allows you to customize various aspects of the deployment without modifying the main `docker-compose.yml` file.