[PR #1422] [CLOSED] minor: allow specifying source location when building via docker #1818

Closed
opened 2026-03-02 11:59:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karakeep-app/karakeep/pull/1422
Author: @thiswillbeyourgithub
Created: 5/17/2025
Status: Closed

Base: mainHead: docker_specify_source_dir


📝 Commits (2)

  • f13312f new: allow to specify the source directory when building
  • 14d4e2a update the docker compose files to use SOURCE_DIR

📊 Changes

4 files changed (+26 additions, -10 deletions)

View changed files

📝 docker/Dockerfile (+12 -5)
📝 docker/Dockerfile.dev (+3 -2)
📝 docker/docker-compose.build.yml (+2 -0)
📝 docker/docker-compose.dev.yml (+9 -3)

📄 Description

  • new: allow to specify the source directory when building
  • update the docker compose files to use SOURCE_DIR

Hi,

This is low importance, maybe a mistake, if the reviewer is low on bandwidth please consider skipping this one and reviewing other PRs instead, thanks!

I'm fairly new to docker and had some trouble getting the building process to work after modifying the sources.

My issue was mainly that because the sources are mounted to /app, and the building process outputs to /app, I could build the container but to run it I'd have to comment the runtime volume mounting at /app (because it happens after docker loads the built output).

I ended up figuring out how to modify the Dockerfile files to make them accept a source dir.

This has been working well for me but I'm not sure if it can break things for others.

For reference, here's how my own docker-compose.yml file is setup that I run with `docker compose up web --build:

services:
  web:
    restart: unless-stopped
    volumes:
      - ./data/web:/data
      - ./thefork:/appsource

    # To either run from image or build from scratch, uncomment one of the two sections

    # # START OF FROM IMAGE
    # image: ghcr.io/karakeep-app/karakeep:${KARAKEEP_VERSION:-release}
    # # END OF FROM IMAGE

    # # To build the app:
    # 0. comment the image: above
    # 1. uncomment the building lines below
    # # START OF BUILDING
    build:
      context: ./thefork
      target: aio
      dockerfile: docker/Dockerfile
      args:
        SOURCE_DIR: /appsource
    working_dir: /app
    # # END OF BUILDING

    # ...rest of the config...

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karakeep-app/karakeep/pull/1422 **Author:** [@thiswillbeyourgithub](https://github.com/thiswillbeyourgithub) **Created:** 5/17/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `docker_specify_source_dir` --- ### 📝 Commits (2) - [`f13312f`](https://github.com/karakeep-app/karakeep/commit/f13312f8d6a892fde090eb1cddf363ed9ffe9558) new: allow to specify the source directory when building - [`14d4e2a`](https://github.com/karakeep-app/karakeep/commit/14d4e2a451710e1530a129dc28d1191f4b925233) update the docker compose files to use SOURCE_DIR ### 📊 Changes **4 files changed** (+26 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `docker/Dockerfile` (+12 -5) 📝 `docker/Dockerfile.dev` (+3 -2) 📝 `docker/docker-compose.build.yml` (+2 -0) 📝 `docker/docker-compose.dev.yml` (+9 -3) </details> ### 📄 Description - **new: allow to specify the source directory when building** - **update the docker compose files to use SOURCE_DIR** Hi, **This is low importance, maybe a mistake, if the reviewer is low on bandwidth please consider skipping this one and reviewing other PRs instead, thanks!** I'm fairly new to docker and had some trouble getting the building process to work after modifying the sources. My issue was mainly that because the sources are mounted to /app, and the building process outputs to /app, I could build the container but to run it I'd have to comment the runtime volume mounting at /app (because it happens after docker loads the built output). I ended up figuring out how to modify the Dockerfile files to make them accept a source dir. This has been working well for me but I'm not sure if it can break things for others. For reference, here's how my own docker-compose.yml file is setup that I run with `docker compose up web --build: ```yml services: web: restart: unless-stopped volumes: - ./data/web:/data - ./thefork:/appsource # To either run from image or build from scratch, uncomment one of the two sections # # START OF FROM IMAGE # image: ghcr.io/karakeep-app/karakeep:${KARAKEEP_VERSION:-release} # # END OF FROM IMAGE # # To build the app: # 0. comment the image: above # 1. uncomment the building lines below # # START OF BUILDING build: context: ./thefork target: aio dockerfile: docker/Dockerfile args: SOURCE_DIR: /appsource working_dir: /app # # END OF BUILDING # ...rest of the config... ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 11:59:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1818
No description provided.