Skip to content

Commit

Permalink
Add initial implementation of Docker gubbins.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Nov 26, 2024
1 parent 7476021 commit 417023d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) Damien Dart, <[email protected]>.
# This file is distributed under the MIT licence. For more information,
# please refer to the accompanying "LICENCE" file.

FROM golang:1.22-alpine AS build
RUN apk add build-base git nodejs upx go-task
WORKDIR /build
COPY . .
RUN go-task build-slim
RUN upx -9 visref

FROM alpine:latest
COPY --from=build /build/visref /usr/local/bin/visref
EXPOSE 4444
ENTRYPOINT ["/usr/local/bin/visref"]
13 changes: 12 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ tasks:
build:
cmds:
- task: 'build:go'
desc: 'Build the "visref" application'

build-slim:
cmds:
- task: 'build:go-slim'
desc: 'Build the "visref" application'

build:css:
cmds:
Expand All @@ -53,7 +59,7 @@ tasks:
vars:
OUTPUT_FILE: 'cmd/visref/assets/app.js'

build:go:
build:go: &build-go
cmds:
- 'go build ./cmd/visref'
deps:
Expand All @@ -70,6 +76,11 @@ tasks:
- 'go.sum'
- 'cmd/visref/assets/favicon.svg'

build:go-slim:
<<: *build-go
cmds:
- 'go build -ldflags "-s -w" -trimpath ./cmd/visref'

dependencies:
cmds:
- task: 'dependencies:javascript'
Expand Down

0 comments on commit 417023d

Please sign in to comment.