Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed makefile for docker #7

Merged
merged 1 commit into from
Apr 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ TEST?=false#is the container test?
LOCAL_PORT=18081#Grpc port for local
CONTAINER_PORT=18080#Grpc port in container
NETWORK=op#Docker network name
POSTGRES_USERNAME?=op#Postgres Db User Name
POSTGRES_PASSWORD?=op#Postgres Db Password
JWT_SECRET_KEY?=op#Jwt Secret Key
REDIS_PASSWORD?=op#Redis Password

GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
Expand Down Expand Up @@ -49,8 +53,13 @@ lint: ## Use golintci-lint on your project
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:latest-alpine golangci-lint run --deadline=65s $(OUTPUT_OPTIONS)

## Docker:
docker-build: ## Use the dockerfile to build the container
docker build --rm --tag $(DOCKER_REPOSITORY)/$(DOCKER_CONTAINER) --build-arg TEST=$(TEST) .
docker-build: ## Use the Dockerfile to build the container
docker build --rm --tag $(DOCKER_REPOSITORY)/$(DOCKER_CONTAINER) \
--build-arg TEST=$(TEST) \
--build-arg POSTGRES_USERNAME=$(POSTGRES_USERNAME) \
--build-arg POSTGRES_PASSWORD=$(POSTGRES_PASSWORD) \
--build-arg JWT_SECRET_KEY=$(JWT_SECRET_KEY) \
--build-arg REDIS_PASSWORD=$(REDIS_PASSWORD) .

docker-release: ## Release the container with tag latest and version
docker tag $(DOCKER_REPOSITORY)/$(DOCKER_CONTAINER) $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_CONTAINER):latest
Expand Down
Loading