Skip to content

Commit

Permalink
feat: use packr for assets
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Jun 21, 2020
1 parent 8611493 commit dc50a9e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Specific to .dockerignore
##

.git/
#.git/
Dockerfile
contrib/

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
packrd/
*-packr.go
config.txt
# Temporary files
*~
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ ARG VERSION
# build
FROM golang:1.14-alpine as builder
RUN apk add --no-cache git gcc musl-dev make
RUN go get -u github.com/gobuffalo/packr/v2/packr2
ENV GO111MODULE=on
WORKDIR /go/src/moul.io/bounce
COPY go.* ./
RUN go mod download
COPY . ./
RUN make packr
RUN make install

# minimalist runtime
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ run-discord: install
run-server: install
bounce --dev-mode --enable-server run

.PHONY: packr
packr:
(cd static; git clean -fxd)
packr2

.PHONY: docker.push
docker.push: generate docker.build
docker.push: tidy generate docker.build
docker push $(DOCKER_IMAGE)

PROTOS_SRC := $(wildcard ./api/*.proto)
Expand Down
6 changes: 5 additions & 1 deletion go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dc50a9e

Please sign in to comment.