Skip to content

Commit

Permalink
WIP docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
bgentry committed Apr 21, 2024
1 parent e30b1a9 commit 940cad9
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env.*
ui/.env.*
ui/dist
ui/node_modules
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# syntax=docker/dockerfile:1
FROM node:20-alpine AS build-ui
WORKDIR /app
COPY ui/package.json ui/package-lock.json ./
RUN npm install
ENV NODE_ENV=production
COPY ui/ .
RUN npm run build

# Build the Go binary, including embedded UI files:
FROM golang:1.22.2-alpine AS build-go
WORKDIR /go/src/riverui

COPY go.mod go.sum ./
RUN go mod download

# Copy Go files without copying the ui dir:
COPY *.go ./
COPY internal/ internal/
RUN ls -la
COPY ui/*.go ./ui/
COPY --from=build-ui /app/dist ./ui/dist

RUN go build -o /bin/riverui .

FROM alpine:3.19.1
COPY --from=build-go /bin/riverui /bin/riverui
CMD ["/bin/riverui"]
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22

require (
github.com/jackc/pgx/v5 v5.5.5
github.com/riverqueue/river v0.0.14
github.com/riverqueue/river v0.3.0
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.3.0
github.com/riverqueue/river/rivertype v0.3.0
github.com/rs/cors v1.10.0
Expand All @@ -21,15 +21,15 @@ require (
github.com/samber/slog-http v1.0.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/text v0.14.0 // indirect
)

replace github.com/riverqueue/river => ../river
// replace github.com/riverqueue/river => ../river

replace github.com/riverqueue/river/riverdriver => ../river/riverdriver
// replace github.com/riverqueue/river/riverdriver => ../river/riverdriver

replace github.com/riverqueue/river/rivertype => ../river/rivertype
// replace github.com/riverqueue/river/rivertype => ../river/rivertype

replace github.com/riverqueue/river/riverdriver/riverpgxv5 => ../river/riverdriver/riverpgxv5
// replace github.com/riverqueue/river/riverdriver/riverpgxv5 => ../river/riverdriver/riverpgxv5
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/river v0.3.0 h1:iOZJLfnZFkMa6F3Q26yXw2+E0b0SeUSfvvVbxWFe9hE=
github.com/riverqueue/river v0.3.0/go.mod h1:8H7MapSOj21+IoUrJ+zFZiL5JhdC018hDe6rJXDCAWo=
github.com/riverqueue/river/riverdriver v0.3.0 h1:AfPs33fusZYKNA7em2SJK1mI6gyhEQYV7nMyJECNKUQ=
github.com/riverqueue/river/riverdriver v0.3.0/go.mod h1:3wctSbzy0XotE7e+9yFNOACKZ3xOkzyUDB4IqYbMBl0=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.3.0 h1:jlayc9iPuV4iTOzFhCLhEWEnzRcMVF8K/k8VJ/peT/c=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.3.0/go.mod h1:7nXqSdO7NDWjG0Ua9rfsrwLjPtW0o+1bDt90iRBbTG0=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.3.0 h1:rUVslUUAGr5Am35YxYAKT+QgGL3k/1MhfBHxHP/zWJ0=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.3.0/go.mod h1:zkQ+Do0tB+RDOshJYnCIIt4gL1TAOHYv/xZPZ9fRf80=
github.com/riverqueue/river/rivertype v0.3.0 h1:xIpdE0cRmx+CGXsmASeRSvsFaaH7ipWEGHPlLRKpKW8=
github.com/riverqueue/river/rivertype v0.3.0/go.mod h1:nDd50b/mIdxR/ezQzGS/JiAhBPERA7tUIne21GdfspQ=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8=
Expand All @@ -40,6 +48,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
Expand Down

0 comments on commit 940cad9

Please sign in to comment.