Skip to content

Commit

Permalink
chore: use compose watch
Browse files Browse the repository at this point in the history
  • Loading branch information
ucpr committed Jul 13, 2024
1 parent 16e4fcb commit 1014391
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ ARG TIMESTAMP

WORKDIR /app

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

RUN go mod download && go build -ldflags "-X github.com/ucpr/mongo-streamer/pkg/stamp.BuildVersion=${VERSION} -X github.com/ucpr/mongo-streamer/pkg/stamp.BuildRevision=${REVISION} -X github.com/ucpr/mongo-streamer/pkg/stamp.BuildTimestamp=${TIMESTAMP}" -o ./build/mongo-streamer ./cmd
COPY . .
RUN go build -ldflags "-X github.com/ucpr/mongo-streamer/pkg/stamp.BuildVersion=${VERSION} -X github.com/ucpr/mongo-streamer/pkg/stamp.BuildRevision=${REVISION} -X github.com/ucpr/mongo-streamer/pkg/stamp.BuildTimestamp=${TIMESTAMP}" -o ./build/mongo-streamer ./cmd

## Runner
FROM alpine:3.18
Expand Down
12 changes: 9 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ services:
"
mongo-streamer:
build: .
build:
context: .
restart: always
depends_on:
- setup-mongo-replica
Expand All @@ -59,8 +60,13 @@ services:
develop:
watch:
- action: rebuild
files:
- ./
path: .
ignore:
- .git
- .gitignore
- README.md
- ./bin
- ./monitors
environment:
MONGO_DB_URI: "mongodb://mongo:27017/test?tls=false&directConnection=true&retryWrites=false&replicaSet=rs0"
MONGO_DB_COLLECTION: tweets
Expand Down

0 comments on commit 1014391

Please sign in to comment.