Skip to content

Commit 8a85698

Browse files
committed
Added Dockerfile
1 parent 712c5d4 commit 8a85698

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
bin

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM golang:alpine
2+
WORKDIR /app
3+
COPY . /app
4+
EXPOSE 53273
5+
RUN apk add --no-cache make
6+
RUN make linux
7+
ENTRYPOINT ["./bin/server_linux"]

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SRC := cmd/server/main.go
22
TEMPL := github.com/a-h/templ/cmd/templ@latest
3+
ARGS := $(filter-out $@,$(MAKECMDGOALS))
34
win32:
45
@GOOS=windows go build -o bin/server_$@.exe $(SRC)
56
linux:
@@ -16,6 +17,8 @@ format:
1617
@go fmt ./...
1718
run:
1819
@go run $(SRC) $(filter-out $@,$(MAKECMDGOALS))
20+
docker:
21+
@docker build . -t server
1922
all: win32 linux darwin
2023
%:
2124
@:

0 commit comments

Comments
 (0)