Dokku deployment recipe
This commit is contained in:
parent
b996a07cbd
commit
e26cb7ad49
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
||||
/data
|
||||
/.vscode
|
||||
/vendor
|
||||
/bin
|
||||
/release
|
24
Makefile
24
Makefile
@ -1,16 +1,17 @@
|
||||
build:
|
||||
DOKKU_HOST := dokku@dev.lookingfora.name
|
||||
SHELL := /bin/bash
|
||||
|
||||
build: vendor-server
|
||||
build:
|
||||
CGO_ENABLED=0 go build -mod=vendor -v -o ./bin/server ./cmd/server
|
||||
|
||||
test:
|
||||
go test -v -race ./...
|
||||
|
||||
release:
|
||||
release: vendor
|
||||
@$(SHELL) ./misc/script/release.sh
|
||||
|
||||
vendor-%:
|
||||
cd cmd/$* && go mod vendor
|
||||
vendor:
|
||||
go mod vendor
|
||||
|
||||
tidy:
|
||||
go mod tidy
|
||||
@ -27,4 +28,17 @@ clean:
|
||||
rm -rf vendor
|
||||
rm -rf bin
|
||||
|
||||
dokku-build:
|
||||
docker build \
|
||||
-f ./misc/dokku/Dockerfile \
|
||||
-t goweb-oidc-dokku:latest \
|
||||
.
|
||||
|
||||
dokku-run:
|
||||
docker run -it --rm -p 3002:3002 goweb-oidc-dokku:latest
|
||||
|
||||
dokku-deploy:
|
||||
$(if $(shell git config remote.dokku-oidc-test.url),, git remote add dokku-oidc-test $(DOKKU_HOST):oidc-test)
|
||||
git push -f dokku-oidc-test $(shell git rev-parse HEAD):refs/heads/master
|
||||
|
||||
.PHONY: lint watch build vendor tidy release
|
24
misc/dokku/Dockerfile
Normal file
24
misc/dokku/Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
FROM golang:1.13 AS build
|
||||
|
||||
ARG HTTP_PROXY=
|
||||
ARG HTTPS_PROXY=
|
||||
ARG http_proxy=
|
||||
ARG https_proxy=
|
||||
|
||||
RUN apt-get update && apt-get install -y build-essential git bash
|
||||
|
||||
COPY . /src
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
RUN make ARCH_TARGETS=amd64 release
|
||||
|
||||
FROM busybox
|
||||
|
||||
COPY --from=build /src/release/server-linux-amd64 /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV HTTP_ADDRESS=:80
|
||||
|
||||
CMD ["bin/server", "-workdir", "/app", "-config", "server.yml"]
|
@ -104,7 +104,6 @@ function release_server {
|
||||
dump_default_conf 'server' $os $arch
|
||||
|
||||
copy 'server' $os $arch "$PROJECT_DIR/README.md" "README.md"
|
||||
copy 'server' $os $arch "$PROJECT_DIR/cmd/server/public" "public"
|
||||
copy 'server' $os $arch "$PROJECT_DIR/cmd/server/template" "template"
|
||||
|
||||
compress 'server' $os $arch
|
||||
|
Loading…
Reference in New Issue
Block a user