update docker

This commit is contained in:
2025-08-05 09:52:56 -05:00
parent 8d4c8f71b0
commit 421862fd96
7 changed files with 13 additions and 9 deletions

1
.gitignore vendored
View File

@@ -10,3 +10,4 @@ secrets.json
flaticon_svgs
flaticon_colored_svgs
icons
bin

View File

@@ -6,7 +6,6 @@ WORKDIR /app
# volume for nkode.db
VOLUME /app/data/sqlite
VOLUME /app/data/icons
# Copy go.mod and go.sum files
COPY go.mod go.sum ./
@@ -19,7 +18,7 @@ RUN go mod download
COPY . .
# Build the application
RUN go build -o go-nkode ./cmd
RUN go build -o go-nkode ./cmd/restapi
# Stage 2: Runtime
FROM debian:bookworm-slim
@@ -32,8 +31,6 @@ RUN apt-get update && \
#ENV FRONTEND_HOST=https://app.nkode.tech
#ENV FRONTEND_HOST=http://localhost:8090
ENV SVG_DIR=/app/data/icons
ENV DB_PATH=/app/data/sqlite/nkode.db
ENV SQLITE_DB=/app/data/sqlite/nkode.db
# Set the working directory inside the runtime container

View File

@@ -29,7 +29,7 @@ tasks:
- docker system prune -f
push:
cmds:
- docker buildx build --platform linux/amd64,linux/arm64 -t registry.infra.nkode.tech/go-nkode:latest --push .
- docker buildx build --platform linux/amd64,linux/arm64 -t registry.infra.nkode.tech/go-nkode:dod --push .
exec:
cmds:
- docker exec -it cron-nkode bash

View File

@@ -1,10 +1,9 @@
services:
go-nkode:
container_name: go-nkode
image: registry.infra.nkode.tech/go-nkode
image: registry.infra.nkode.tech/go-nkode:dod
volumes:
- /var/go-nkode/sqlite:/app/data/sqlite
- /var/go-nkode/icons:/app/data/icons
environment:
- JWT_SECRET=${JWT_SECRET}

View File

@@ -245,7 +245,7 @@ func (n *NKodeAPI) RenewAttributes(customerId models.CustomerID) error {
}
func (n *NKodeAPI) RandomSvgInterface() ([]string, error) {
return n.Db.RandomSvgInterface(entities.KeypadMax)
return n.Db.RandomSvgInterface(entities.KeypadDefault)
}
func (n *NKodeAPI) RefreshToken(userEmail models.UserEmail, customerId models.CustomerID, refreshToken string) (string, error) {

View File

@@ -26,7 +26,7 @@ type Root struct {
func main() {
testDbPath := os.Getenv("TEST_DB_PATH")
dbPath := os.Getenv("DB_PATH")
dbPath := os.Getenv("SQLITE_PATH")
dbPaths := []string{testDbPath, dbPath}
flaticonSvgDir := os.Getenv("SVG_DIR")
//dbPath := "/Users/donov/Desktop/nkode.db"

7
scripts/bash/scp_db.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
./rebuild_db.sh
sqlite_db="$HOME/databases/demo.db"
scp $sqlite_db root@nkode.tech:/var/go-nkode/sqlite/demo.db