Skip to content

Commit

Permalink
Add docker packaging
Browse files Browse the repository at this point in the history
* Use `make docker` to build locally
  • Loading branch information
BuJo committed Oct 2, 2024
1 parent c7141ff commit d718b62
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!pkg/web/public/
!bin/
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM gcr.io/distroless/static-debian12

EXPOSE 3000

COPY bin/tales-server /

VOLUME /work

ENTRYPOINT ["/tales-server"]
CMD ["-projects", "/work"]
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BINARIES=${SERVER_BINARY} ${MIGRATE_BINARY}
coverage coverage-go coverage-js \
lint lint-go lint-js \
test test-go test-js \
run dist
run dist docker

all: build

Expand Down Expand Up @@ -98,6 +98,11 @@ tales-server.zip: bin/* pkg/web/public/*
dist-js:
npm run dist

CONTAINER_BUILDER := $(shell which docker 2>/dev/null || which podman 2>/dev/null)
docker:
CGO_ENABLED=0 go build -ldflags "$(LDFLAGS) -extldflags=-static" -o bin/tales-server $(PKG)/cmd/tales-server
${CONTAINER_BUILDER} build -t tales .

clean: clean-go clean-js

clean-go:
Expand Down

0 comments on commit d718b62

Please sign in to comment.