···11-# Use the Go 1.23 alpine official image
22-# https://hub.docker.com/_/golang
33-FROM golang:1.23-alpine
44-55-# Create and change to the app directory.
66-WORKDIR /app
77-88-# Copy go mod and sum files
99-COPY go.mod go.sum ./
1010-1111-# Copy local code to the container image.
1212-COPY . ./
1313-1414-# Install project dependencies
1515-RUN CGO_ENABLED=1 go mod download
1616-1717-# Build the app
1818-RUN go build -o app
1919-2020-# Run the service on container startup.
2121-ENTRYPOINT ["./app"]
+2-2
database.go
···88 "os"
991010 "github.com/bugsnag/bugsnag-go/v2"
1111- _ "github.com/mattn/go-sqlite3"
1111+ _ "github.com/glebarez/go-sqlite"
1212)
13131414func db() {
···2424 file.Close()
2525 log.Println("sqlite-database.db created")
26262727- sqliteDatabase, _ := sql.Open("sqlite3", "./sqlite-database.db") // Open the created SQLite File
2727+ sqliteDatabase, _ := sql.Open("sqlite", "./sqlite-database.db") // Open the created SQLite File
2828 defer sqliteDatabase.Close()
29293030 createTable(sqliteDatabase)