diff --git a/Dockerfile b/Dockerfile index a8857c5..326626b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ COPY --from=builder /usr/src/autotasker/migrations/all.sql /usr/local/src/autota COPY --from=builder /usr/src/autotasker/init_db.sh /usr/local/bin/autotasker_init_db.sh COPY --from=builder /usr/src/autotasker/assets /usr/local/lib/autotasker/assets -USER 1000 ENV RUST_LOG=info ENV RUST_BACKTRACE=1 diff --git a/init_db.sh b/init_db.sh index b88016a..3241c67 100755 --- a/init_db.sh +++ b/init_db.sh @@ -6,4 +6,5 @@ DEFAULT_MIGRATION_PATH="/usr/local/src/autotasker/migrations/all.sql" DB_PATH="${DB_PATH:-$DEFAULT_DB_PATH}" MIGRATION_PATH="${MIGRATION_PATH:-$DEFAULT_MIGRATION_PATH}" +echo "Initializing db at $DB_PATH from schema at $MIGRATION_PATH" sqlite3 $DB_PATH < $MIGRATION_PATH diff --git a/justfile b/justfile index 3f05c9d..7e0750b 100644 --- a/justfile +++ b/justfile @@ -2,16 +2,16 @@ export RUST_BACKTRACE := "1" export RUST_LOG := "trace" watch-run: - cargo-watch -x 'run -- --config config.yaml --database ./tmp/dbs/autotasker.db' + cargo-watch -x 'run -- --config config.yaml --database ./tmp/dbs/autotasker.db --static-assets ./assets' run: cargo run -- --database ./tmp/dbs/autotasker.db --config ./config.yaml --static-assets ./assets docker-run: - docker run -p 3085:8080 -v ./config:/etc/autotasker -v ./db:/var/lib/autotasker autotasker + docker run -p 3085:8080 -v ./tmp/docker/config:/etc/autotasker -v ./tmp/docker/db:/var/lib/autotasker autotasker docker-init-db: - docker run -v ./config:/etc/autotasker -v ./db:/var/lib/autotasker autotasker /usr/local/bin/autotasker_init_db.sh + docker run -v ./tmp/docker/config:/etc/autotasker -v ./tmp/docker/db:/var/lib/autotasker autotasker /usr/local/bin/autotasker_init_db.sh docker-build: docker build -t autotasker .