Skip to content

Commit

Permalink
Improved Makefile and controller Dockerfile (#27)
Browse files Browse the repository at this point in the history
* Optimized dockerfile to prevent re-installing dependencies on every code change

* Updated outdated docker compose syntax in Makefile

* Updated Makefile with up/down/help commands

* Updated Makefile
  • Loading branch information
nschenone authored Oct 14, 2024
1 parent 174fdfa commit c13c4e9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,27 @@

CONTROLLER_NAME = "genai-factory-controller"

.PHONY: genai-factory
genai-factory:
.PHONY: help
help: ## Display available commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: all
all:
$(error please pick a target)

.PHONY: up
up: ## Deploy GenAI factory controller and UI
# Build the Docker image using the
docker-compose up -d --build
docker compose up -d --build
@echo "GenAI Factory Controller and UI application are running in the background"
@echo "UI application is available at http://localhost:3000"
@echo "Controller API is available at http://localhost:8001"

.PHONY: down
down: ## Stop GenAI factory controller and UI
# Build the Docker image using the
docker compose down

.PHONY: controller
controller:
# Build controller's image:
Expand Down
10 changes: 6 additions & 4 deletions controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ RUN apt update -qqq \
&& rm -rf /var/lib/apt/lists/* \

WORKDIR /controller
COPY /controller/src /controller/src

# Install requirements:
COPY /controller/requirements.txt /controller/
RUN pip install -r /controller/requirements.txt

# Copy controller source code
COPY /controller/src /controller/src

# Make the data directory:
RUN mkdir -p ../data

# Install requirements:
RUN pip install -r /controller/requirements.txt

# Set python path environment variable:
ENV PYTHONPATH="/controller/src"
ENV CTRL_DATA_PATH="/data"
Expand Down

0 comments on commit c13c4e9

Please sign in to comment.