Skip to content

Commit

Permalink
fix: set default configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioromagnollo committed Oct 12, 2023
1 parent 2d5f3a1 commit ab37dca
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KREST_APP_ENV=development
KREST_APP_NAME=kafkarest
KREST_APP_PORT=8888
PORT=8888

# Kafka Config
KREST_KAFKA_HOST=localhost:9092
KAFKA_HOST=localhost:9092
4 changes: 2 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KREST_APP_ENV=test
KREST_APP_NAME=kafkarest
KREST_APP_PORT=8889
PORT=8889

# Kafka Config
KREST_KAFKA_HOST=localhost:9092
KAFKA_HOST=localhost:9092
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /app
COPY . .
RUN GOOS=linux go build -ldflags="-w -s" -o api cmd/api/main.go

FROM golang:1.20.6 AS final
FROM scratch
WORKDIR /
COPY --from=builder /app/api .
EXPOSE 8080
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dev: ## Run the app in development mode
APP_ENV=development go run cmd/api/main.go
.PHONY: dev
.PHONY: dev

up:
@docker-compose up --build -d
.PHONY: up
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3'

services:
kafka-rest:
container_name: kafka-rest
image: mauricioromagnollo/kafka-rest:latest
ports:
- "8080:8080"
environment:
- KAFKA_HOST=kafka:29092

# kafka-rest-test:
# container_name: kafka-rest-test
# build:
# context: .
# dockerfile: Dockerfile
# ports:
# - "8082:8080"
# volumes:
# - .:/app
5 changes: 4 additions & 1 deletion request.http
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ POST http://localhost:8888/publish
"message": {
"foo": "bar"
}
}
}

###
GET http://localhost:8082/status

0 comments on commit ab37dca

Please sign in to comment.