🧑💻(frontend) enable frontend service in docker compose
Added configuration to docker-compose stack allowing users to run the frontend in production mode. This simplifies the developer onboarding, for those wanting to run the project locally.
This commit is contained in:
committed by
aleb_the_flash
parent
9eae98ed16
commit
a8e1bbe085
22
Makefile
22
Makefile
@@ -88,10 +88,20 @@ bootstrap: \
|
|||||||
.PHONY: bootstrap
|
.PHONY: bootstrap
|
||||||
|
|
||||||
# -- Docker/compose
|
# -- Docker/compose
|
||||||
build: ## build the app-dev container
|
build: ## build the project containers
|
||||||
@$(COMPOSE) build app-dev --no-cache
|
@$(MAKE) build-backend
|
||||||
|
@$(MAKE) build-frontend
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
|
|
||||||
|
build-backend: ## build the app-dev container
|
||||||
|
@$(COMPOSE) build app-dev
|
||||||
|
.PHONY: build-backend
|
||||||
|
|
||||||
|
|
||||||
|
build-frontend: ## build the frontend container
|
||||||
|
@$(COMPOSE) build frontend
|
||||||
|
.PHONY: build-frontend
|
||||||
|
|
||||||
down: ## stop and remove containers, networks, images, and volumes
|
down: ## stop and remove containers, networks, images, and volumes
|
||||||
@$(COMPOSE) down
|
@$(COMPOSE) down
|
||||||
.PHONY: down
|
.PHONY: down
|
||||||
@@ -100,10 +110,16 @@ logs: ## display app-dev logs (follow mode)
|
|||||||
@$(COMPOSE) logs -f app-dev
|
@$(COMPOSE) logs -f app-dev
|
||||||
.PHONY: logs
|
.PHONY: logs
|
||||||
|
|
||||||
run: ## start the wsgi (production) and development server
|
run-backend: ## start only the backend application and all needed services
|
||||||
@$(COMPOSE) up --force-recreate -d celery-dev
|
@$(COMPOSE) up --force-recreate -d celery-dev
|
||||||
@echo "Wait for postgresql to be up..."
|
@echo "Wait for postgresql to be up..."
|
||||||
@$(WAIT_DB)
|
@$(WAIT_DB)
|
||||||
|
.PHONY: run-backend
|
||||||
|
|
||||||
|
run:
|
||||||
|
run: ## start the wsgi (production) and development server
|
||||||
|
@$(MAKE) run-backend
|
||||||
|
@$(COMPOSE) up --force-recreate -d frontend
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
|
|
||||||
status: ## an alias for "docker compose ps"
|
status: ## an alias for "docker compose ps"
|
||||||
|
|||||||
12
compose.yml
12
compose.yml
@@ -95,6 +95,18 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- keycloak
|
- keycloak
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
user: "${DOCKER_USER:-1000}"
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./src/frontend/Dockerfile
|
||||||
|
target: frontend-production
|
||||||
|
args:
|
||||||
|
VITE_API_BASE_URL: "http://localhost:8071"
|
||||||
|
image: meet:frontend-development
|
||||||
|
ports:
|
||||||
|
- "3000:8080"
|
||||||
|
|
||||||
dockerize:
|
dockerize:
|
||||||
image: jwilder/dockerize
|
image: jwilder/dockerize
|
||||||
platform: linux/x86_64
|
platform: linux/x86_64
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ FROM meet AS meet-builder
|
|||||||
|
|
||||||
WORKDIR /home/frontend
|
WORKDIR /home/frontend
|
||||||
|
|
||||||
|
ARG VITE_API_BASE_URL
|
||||||
|
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# ---- Front-end image ----
|
# ---- Front-end image ----
|
||||||
|
|||||||
Reference in New Issue
Block a user