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_svgs
flaticon_colored_svgs flaticon_colored_svgs
icons icons
bin

View File

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

View File

@@ -29,7 +29,7 @@ tasks:
- docker system prune -f - docker system prune -f
push: push:
cmds: 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: exec:
cmds: cmds:
- docker exec -it cron-nkode bash - docker exec -it cron-nkode bash

View File

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

View File

@@ -245,7 +245,7 @@ func (n *NKodeAPI) RenewAttributes(customerId models.CustomerID) error {
} }
func (n *NKodeAPI) RandomSvgInterface() ([]string, 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) { 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() { func main() {
testDbPath := os.Getenv("TEST_DB_PATH") testDbPath := os.Getenv("TEST_DB_PATH")
dbPath := os.Getenv("DB_PATH") dbPath := os.Getenv("SQLITE_PATH")
dbPaths := []string{testDbPath, dbPath} dbPaths := []string{testDbPath, dbPath}
flaticonSvgDir := os.Getenv("SVG_DIR") flaticonSvgDir := os.Getenv("SVG_DIR")
//dbPath := "/Users/donov/Desktop/nkode.db" //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