🚀 Add docker

This commit is contained in:
Dan Jones 2025-05-16 16:15:15 -05:00
commit 8e84c35210
Signed by: dan
GPG key ID: 5B3B0F7217473A29
2 changed files with 35 additions and 0 deletions

22
broker-service/Dockerfile Normal file
View file

@ -0,0 +1,22 @@
# base go image
FROM golang:1.24-alpine as builder
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN go mod download
RUN CGO_ENABLED=0 go build -o brokerService ./broker-service/cmd/api
RUN chmod +x /app/brokerService
# build a tiny docker image
FROM alpine:latest
RUN mkdir /app
COPY --from=builder /app/brokerService /app
CMD [ "/app/brokerService" ]

13
docker-compose.yml Normal file
View file

@ -0,0 +1,13 @@
version: '3'
services:
broker-service:
build:
context: ./
dockerfile: ./broker-service/Dockerfile
restart: always
ports:
- "8080:8085"
deploy:
mode: replicated
replicas: 1