ok i think this good :3

This commit is contained in:
user
2025-08-14 19:58:53 -07:00
parent f8a8963cab
commit b5f0253e65
4 changed files with 26 additions and 28 deletions

38
.gitignore vendored
View File

@@ -1,34 +1,26 @@
# ---> Go
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
# 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.
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Recommended: Go.AllowList.gitignore
# Test binary, built with `go test -c`
*.test
# Ignore everything
*
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# But not these files...
!/.gitignore
# Dependency directories (remove the comment below to include it)
# vendor/
!*.go
!go.sum
!go.mod
# Go workspace file
go.work
go.work.sum
!docker-deploy.sh
!Dockerfile
# env file
.env
!README.md
!LICENSE
# !Makefile
# ...even if they are in subdirectories
!*/
# ---> Custom
db

View File

@@ -1,5 +1,5 @@
FROM alpine
WORKDIR /app
COPY noteserver .
RUN chmod +x /app/noteserver
CMD ["/app/noteserver"]
COPY . .
RUN apk update && apk add go && go build .
CMD ["./noteserver"]

View File

@@ -1,5 +1,11 @@
#!/bin/bash
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o noteserver .
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
echo "[#] sudo $0 $@"
exec sudo "$0" "$@"
fi
docker build -t noteserver .
docker rm noteserver
docker run -d -p 80:3000 --name noteserver noteserver
docker run -d -p 3002:3000 --name noteserver noteserver

Binary file not shown.