From 463f0414fcedff732cfdc38d369c394b8a05be7a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 13 Jul 2025 02:07:05 +0900 Subject: feat(backend): change db file path --- Dockerfile | 1 + backend/main.go | 2 +- compose.yaml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c73319b..64cc431 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,7 @@ FROM alpine WORKDIR /app COPY --from=backend-builder /app/feedaka /app +RUN mkdir -p /app/data EXPOSE 8080 CMD ["/app/feedaka"] diff --git a/backend/main.go b/backend/main.go index ecfcbae..3bbe2f7 100644 --- a/backend/main.go +++ b/backend/main.go @@ -154,7 +154,7 @@ func main() { } var err error - database, err = sql.Open("sqlite3", "feedaka.db") + database, err = sql.Open("sqlite3", "data/feedaka.db") if err != nil { log.Fatal(err) } diff --git a/compose.yaml b/compose.yaml index 69dad6f..1a40ecc 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,7 +3,7 @@ services: build: context: . volumes: - - ./data/feedaka.db:/app/feedaka.db + - ./data/feedaka.db:/app/data/feedaka.db ports: - '127.0.0.1:8002:8080' environment: -- cgit v1.2.3-70-g09d2