mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 19:13:51 +00:00
proxy updates
This commit is contained in:
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,4 +0,0 @@
|
|||||||
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
|
|
||||||
|
|
||||||
# Mark any vendored files as having been vendored.
|
|
||||||
vendor/* linguist-vendored
|
|
||||||
5
Caddyfile.dev
Normal file
5
Caddyfile.dev
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
localhost
|
||||||
|
|
||||||
|
encode gzip
|
||||||
|
|
||||||
|
reverse_proxy landing:3000
|
||||||
13
Makefile
13
Makefile
@@ -6,21 +6,11 @@ PROJECT_SOURCES := "https://github.com/timmypidashev/web"
|
|||||||
PROJECT_REGISTRY := "ghcr.io/timmypidashev/web"
|
PROJECT_REGISTRY := "ghcr.io/timmypidashev/web"
|
||||||
PROJECT_ORGANIZATION := "org.opencontainers"
|
PROJECT_ORGANIZATION := "org.opencontainers"
|
||||||
|
|
||||||
CONTAINER_PROXY_NAME := "proxy"
|
|
||||||
CONTAINER_PROXY_VERSION := "v0.0.1"
|
|
||||||
CONTAINER_PROXY_LOCATION := "src/proxy"
|
|
||||||
CONTAINER_PROXY_DESCRIPTION := "A Caddy reverse proxy."
|
|
||||||
|
|
||||||
CONTAINER_LANDING_NAME := "landing"
|
CONTAINER_LANDING_NAME := "landing"
|
||||||
CONTAINER_LANDING_VERSION := "v1.0.0"
|
CONTAINER_LANDING_VERSION := "v1.0.0"
|
||||||
CONTAINER_LANDING_LOCATION := "src/web/landing"
|
CONTAINER_LANDING_LOCATION := "src/landing"
|
||||||
CONTAINER_LANDING_DESCRIPTION := "The landing page for my website."
|
CONTAINER_LANDING_DESCRIPTION := "The landing page for my website."
|
||||||
|
|
||||||
CONTAINER_BLOG_NAME := "blog"
|
|
||||||
CONTAINER_BLOG_VERSION := "v0.0.0"
|
|
||||||
CONTAINER_BLOG_LOCATION := "src/web/blog"
|
|
||||||
CONTAINER_BLOG_DESCRIPTION := "The blog page for my website."
|
|
||||||
|
|
||||||
.DEFAULT_GOAL := help
|
.DEFAULT_GOAL := help
|
||||||
.PHONY: run build push prune bump
|
.PHONY: run build push prune bump
|
||||||
.SILENT: run build push prune bump
|
.SILENT: run build push prune bump
|
||||||
@@ -53,6 +43,7 @@ run:
|
|||||||
|
|
||||||
docker compose -f compose.$(word 2,$(MAKECMDGOALS)).yml up --remove-orphans
|
docker compose -f compose.$(word 2,$(MAKECMDGOALS)).yml up --remove-orphans
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
# Arguments
|
# Arguments
|
||||||
# [container]: Build context(which container to build ['all' to build every container defined])
|
# [container]: Build context(which container to build ['all' to build every container defined])
|
||||||
|
|||||||
@@ -3,15 +3,12 @@ version: "3.8"
|
|||||||
services:
|
services:
|
||||||
proxy:
|
proxy:
|
||||||
container_name: proxy
|
container_name: proxy
|
||||||
build:
|
image: caddy:latest
|
||||||
context: ./src/proxy
|
|
||||||
dockerfile: Dockerfile.dev
|
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- 80:80
|
||||||
- "443:443"
|
- 443:443
|
||||||
volumes:
|
volumes:
|
||||||
- "./src/proxy/Caddyfile.dev:/Caddyfile.dev:ro"
|
- ./Caddyfile.dev:/etc/caddy/Caddyfile:ro
|
||||||
- "./src/proxy/certs:/certs:rw"
|
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
@@ -20,20 +17,11 @@ services:
|
|||||||
|
|
||||||
landing:
|
landing:
|
||||||
container_name: landing
|
container_name: landing
|
||||||
build:
|
image: landing:dev
|
||||||
context: ./src/landing
|
|
||||||
dockerfile: Dockerfile.dev
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
- "8000:8000"
|
|
||||||
volumes:
|
|
||||||
- "./src/landing:/landing:rw"
|
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
# The proxy network is the only network exposed externally
|
|
||||||
proxy:
|
proxy:
|
||||||
name: proxy
|
name: proxy
|
||||||
|
driver: bridge
|
||||||
|
|||||||
3
src/landing/.dockerignore
Normal file
3
src/landing/.dockerignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.web
|
||||||
|
__pycache__/*
|
||||||
|
Dockerfile
|
||||||
4
src/landing/.gitignore
vendored
Normal file
4
src/landing/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
*.db
|
||||||
|
*.py[cod]
|
||||||
|
.web
|
||||||
|
__pycache__/
|
||||||
20
src/landing/Dockerfile.dev
Normal file
20
src/landing/Dockerfile.dev
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
FROM python:3.11
|
||||||
|
|
||||||
|
# Copy local context to `/app` inside container (see .dockerignore)
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install app requirements and reflex in the container
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Deploy templates and prepare app
|
||||||
|
RUN reflex init
|
||||||
|
|
||||||
|
# Download all npm dependencies and compile frontend
|
||||||
|
RUN reflex export --frontend-only --no-zip
|
||||||
|
|
||||||
|
# Needed until Reflex properly passes SIGTERM on backend.
|
||||||
|
STOPSIGNAL SIGKILL
|
||||||
|
|
||||||
|
# Always apply migrations before starting the backend.
|
||||||
|
CMD reflex run --env dev
|
||||||
BIN
src/landing/assets/favicon.ico
Normal file
BIN
src/landing/assets/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
0
src/landing/landing/__init__.py
Normal file
0
src/landing/landing/__init__.py
Normal file
35
src/landing/landing/landing.py
Normal file
35
src/landing/landing/landing.py
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
|
||||||
|
|
||||||
|
from rxconfig import config
|
||||||
|
|
||||||
|
import reflex as rx
|
||||||
|
|
||||||
|
docs_url = "https://reflex.dev/docs/getting-started/introduction"
|
||||||
|
filename = f"{config.app_name}/{config.app_name}.py"
|
||||||
|
|
||||||
|
|
||||||
|
class State(rx.State):
|
||||||
|
"""The app state."""
|
||||||
|
|
||||||
|
|
||||||
|
def index() -> rx.Component:
|
||||||
|
return rx.center(
|
||||||
|
rx.theme_panel(),
|
||||||
|
rx.vstack(
|
||||||
|
rx.heading("Welcome to Reflex!", size="9"),
|
||||||
|
rx.text("Get started by editing ", rx.code(filename)),
|
||||||
|
rx.button(
|
||||||
|
"Check out our docs!",
|
||||||
|
on_click=lambda: rx.redirect(docs_url),
|
||||||
|
size="4",
|
||||||
|
),
|
||||||
|
align="center",
|
||||||
|
spacing="7",
|
||||||
|
font_size="2em",
|
||||||
|
),
|
||||||
|
height="100vh",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
app = rx.App()
|
||||||
|
app.add_page(index)
|
||||||
1
src/landing/requirements.txt
Normal file
1
src/landing/requirements.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
reflex==0.4.3
|
||||||
5
src/landing/rxconfig.py
Normal file
5
src/landing/rxconfig.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import reflex as rx
|
||||||
|
|
||||||
|
config = rx.Config(
|
||||||
|
app_name="landing",
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user