ok i think this good :3
This commit is contained in:
38
.gitignore
vendored
38
.gitignore
vendored
@@ -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
|
||||
|
@@ -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"]
|
||||
|
@@ -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
|
||||
|
BIN
noteserver
BIN
noteserver
Binary file not shown.
Reference in New Issue
Block a user