diff --git a/.gitignore b/.gitignore index 199b822..a389b93 100644 --- a/.gitignore +++ b/.gitignore @@ -25,26 +25,6 @@ go.work.sum # env file .env -# ---> Go.AllowList -# Allowlisting gitignore template for GO projects prevents us -# from adding various unwanted local files, such as generated -# files, developer configurations or IDE-specific files etc. -# -# Recommended: Go.AllowList.gitignore - -# Ignore everything -* - -# But not these files... -!/.gitignore - -!*.go -!go.sum -!go.mod - -!README.md -!LICENSE - # !Makefile # ...even if they are in subdirectories diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e78ca83 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine +WORKDIR /app +COPY noteserver . +RUN chmod +x /app/noteserver +CMD ["/app/noteserver"] diff --git a/create.sql b/create.sql new file mode 100644 index 0000000..6b85b30 --- /dev/null +++ b/create.sql @@ -0,0 +1,7 @@ +DROP TABLE IF EXISTS notes; +CREATE TABLE notes ( + id TEXT PRIMARY KEY, + user TEXT, + data TEXT +); + diff --git a/docker-deploy.sh b/docker-deploy.sh new file mode 100755 index 0000000..4e191b7 --- /dev/null +++ b/docker-deploy.sh @@ -0,0 +1,5 @@ +#!/bin/bash +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o noteserver . +docker build -t noteserver . +docker rm noteserver +docker run -d -p 80:3000 noteserver --name noteserver diff --git a/noteserver b/noteserver new file mode 100755 index 0000000..bf4085a Binary files /dev/null and b/noteserver differ diff --git a/reload.sh b/reload.sh new file mode 100644 index 0000000..6952bdd --- /dev/null +++ b/reload.sh @@ -0,0 +1,2 @@ +sqlite3 db/notes.db < create.sql +