Shared dirs almost ready :D

This commit is contained in:
Timothy Pidashev
2024-03-11 14:20:55 -07:00
parent 893c59585e
commit 56f799266b
14 changed files with 19 additions and 5 deletions

View File

@@ -147,7 +147,9 @@ define container_build
$(eval TAG := $(PROJECT_REGISTRY)/$(CONTAINER):$(VERSION)), \
)
sudo mount -o bind src/shared src/landing/landing/shared
docker buildx build --load -t $(TAG) -f $(strip $(subst $(SPACE),,$(call container_location,$(CONTAINER))))/Dockerfile.$(ENVIRONMENT) ./$(strip $(subst $(SPACE),,$(call container_location,$(CONTAINER))))/. $(ARGS) $(call labels,$(shell echo $(CONTAINER_NAME) | tr '[:lower:]' '[:upper:]')) --no-cache
sudo umount /src/landing/landing/shared
endef
define container_location
@@ -161,3 +163,11 @@ define container_version
$(shell echo $(strip $(strip $(CONTAINER_$(CONTAINER_NAME)_VERSION))) | tr -d '[:space:]'), \
$(error Version data for container $(1) not found))
endef
define mount_shared
$(sudo mount -o bind src/shared src/landing/landing/shared)
endef
define unmount_shared
$(sudo umount src/shared)
endef

View File

@@ -23,6 +23,7 @@ services:
- ./src/landing/landing:/app/landing
- ./src/landing/assets:/app/assets
- ./src/landing/rxconfig.py:/app/rxconfig.py
- ./src/shared:/app/landing/shared
networks:
- caddy
@@ -33,9 +34,11 @@ services:
- ./src/about/about:/app/about
- ./src/about/assets:/app/assets
- ./src/about/rxconfig.py:/app/rxconfig.py
- ./src/shared:/app/about/shared
networks:
- caddy
networks:
caddy:
name: caddy

View File

@@ -25,7 +25,7 @@ RUN mv .web/_static /tmp/_static
RUN rm -rf .web && mkdir .web
RUN mv /tmp/_static .web/_static
# Stage 2: copy artifacts into slim image
# Stage 2: copy artifacts into slim image
FROM python:3.11-slim
WORKDIR /app
RUN adduser --disabled-password --home /app reflex
@@ -51,4 +51,3 @@ RUN /app/.venv/bin/pip install -r /app/requirements.txt
# The following lines are for the specific command for the application.
CMD reflex init && reflex run --env dev

View File

@@ -1,2 +1,2 @@
from .navbar import navbar
from landing.shared.components import navbar
from .footer import footer

View File

@@ -1,7 +1,7 @@
from landing.route import Route
from .index import index
from .page404 import page404
from landing.shared.pages import page404
routes = [
*[r for r in locals().values() if isinstance(r, Route)],

View File

@@ -36,7 +36,7 @@ def webpage(path: str, title: str = "Timothy Pidashev", props=None) -> Callable:
The component with the template applied.
"""
# Import here to avoid circular imports.
from landing.components.navbar import navbar
from landing.shared.components.navbar import navbar
from landing.components.footer import footer
# Wrap the component in the template.

View File

@@ -0,0 +1 @@
from .navbar import navbar

View File

@@ -0,0 +1 @@
from .page404 import page404

View File

View File