Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3dfb0a2b2f | ||
|
|
7813ffbc66 | ||
|
|
d28918992a |
+7
-2
@@ -69,25 +69,30 @@ WORKDIR /app/
|
|||||||
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
|
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
|
||||||
ENV PATH="/app/.venv/bin:$PATH"
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
|
# Pass version from Makefile to setuptools-scm since .git is not in context
|
||||||
|
ARG SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN
|
||||||
|
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN=$SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
--mount=type=bind,source=brewman/uv.lock,target=uv.lock \
|
--mount=type=bind,source=brewman/uv.lock,target=uv.lock \
|
||||||
--mount=type=bind,source=brewman/pyproject.toml,target=pyproject.toml \
|
--mount=type=bind,source=brewman/pyproject.toml,target=pyproject.toml \
|
||||||
|
--mount=source=.git,target=.git,type=bind \
|
||||||
uv sync --locked --no-install-project
|
uv sync --locked --no-install-project
|
||||||
|
|
||||||
COPY /brewman ./
|
COPY /brewman ./
|
||||||
COPY --from=builder /frontend/browser /app/frontend
|
COPY --from=builder /frontend/browser /app/frontend
|
||||||
|
RUN ls -lah
|
||||||
|
|
||||||
# Sync the project
|
# Sync the project
|
||||||
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
--mount=type=bind,source=brewman/uv.lock,target=uv.lock \
|
--mount=type=bind,source=brewman/uv.lock,target=uv.lock \
|
||||||
--mount=type=bind,source=brewman/pyproject.toml,target=pyproject.toml \
|
--mount=type=bind,source=brewman/pyproject.toml,target=pyproject.toml \
|
||||||
uv sync --locked
|
--mount=source=.git,target=.git,type=bind \
|
||||||
|
uv sync --locked --no-editable
|
||||||
|
|
||||||
ENV PYTHONPATH=/app
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
RUN chmod 777 /app/docker-entrypoint.sh \
|
RUN chmod 777 /app/docker-entrypoint.sh \
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
.PHONY: build-production
|
.PHONY: build-production
|
||||||
build-production: ## Build the production container image. Usage: make build-production TAG=15.4.0
|
build-production: ## Build the production container image. Usage: make build-production TAG=15.4.0
|
||||||
@echo "Cloning repository..."
|
|
||||||
@rm -rf .tmp-brewman
|
|
||||||
@git clone --depth 1 $(if $(TAG),--branch v$(TAG)) git@git.tanshu.com:tanshu/brewman.git .tmp-brewman
|
|
||||||
|
|
||||||
@echo "Building image..."
|
@echo "Building image..."
|
||||||
@podman manifest rm registry.tanshu.com/brewman:latest 2>/dev/null || true
|
@podman manifest rm registry.tanshu.com/brewman:latest 2>/dev/null || true
|
||||||
@podman build \
|
@podman build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--manifest registry.tanshu.com/brewman:latest \
|
--manifest registry.tanshu.com/brewman:latest \
|
||||||
--pull \
|
--pull \
|
||||||
.tmp-brewman || (rm -rf .tmp-brewman && exit 1)
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN=$(TAG) \
|
||||||
@rm -rf .tmp-brewman
|
https://git.tanshu.com/tanshu/brewman.git#v$(TAG)
|
||||||
|
|
||||||
@echo "Pushing manifests..."
|
@echo "Pushing manifests..."
|
||||||
@podman manifest push --all registry.tanshu.com/brewman:latest docker://registry.tanshu.com/brewman:latest
|
@podman manifest push --all registry.tanshu.com/brewman:latest docker://registry.tanshu.com/brewman:latest
|
||||||
@@ -19,15 +15,11 @@ build-production: ## Build the production container image. Usage: make build-pro
|
|||||||
|
|
||||||
.PHONY: build-check
|
.PHONY: build-check
|
||||||
build-check: ## Multi-arch build without push (compile check). Usage: make build-check TAG=15.4.0
|
build-check: ## Multi-arch build without push (compile check). Usage: make build-check TAG=15.4.0
|
||||||
@echo "Cloning repository..."
|
|
||||||
@rm -rf .tmp-brewman
|
|
||||||
@git clone --depth 1 $(if $(TAG),--branch v$(TAG)) git@git.tanshu.com:tanshu/brewman.git .tmp-brewman
|
|
||||||
|
|
||||||
@echo "Building image..."
|
@echo "Building image..."
|
||||||
@podman manifest rm brewman:test 2>/dev/null || true
|
@podman manifest rm brewman:test 2>/dev/null || true
|
||||||
@podman build \
|
@podman build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--manifest brewman:test \
|
--manifest brewman:test \
|
||||||
--pull \
|
--pull \
|
||||||
.tmp-brewman || (rm -rf .tmp-brewman && exit 1)
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN=$(TAG) \
|
||||||
@rm -rf .tmp-brewman
|
https://git.tanshu.com/tanshu/brewman.git#v$(TAG)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "brewman"
|
name = "brewman"
|
||||||
dynamic = ["version"]
|
|
||||||
description = "Accounting plus inventory management for a restaurant."
|
description = "Accounting plus inventory management for a restaurant."
|
||||||
requires-python = ">=3.14"
|
requires-python = ">=3.14"
|
||||||
authors = [{ name = "tanshu", email = "git@tanshu.com" }]
|
authors = [{ name = "tanshu", email = "git@tanshu.com" }]
|
||||||
@@ -24,6 +23,7 @@ dependencies = [
|
|||||||
"sqlalchemy>=2.0.52",
|
"sqlalchemy>=2.0.52",
|
||||||
"uvicorn[standard]>=0.52.4",
|
"uvicorn[standard]>=0.52.4",
|
||||||
]
|
]
|
||||||
|
dynamic = ["version"]
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
dev = [
|
dev = [
|
||||||
@@ -37,12 +37,11 @@ dev = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["hatchling", "hatch-vcs"]
|
requires = ["hatch-vcs", "hatchling"]
|
||||||
build-backend = "hatchling.build"
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
[tool.hatch.version]
|
[tool.hatch.version]
|
||||||
source = "vcs"
|
source = "vcs"
|
||||||
raw-options = { root = "..", fallback_version = "0.0.0" }
|
|
||||||
|
|
||||||
[tool.hatch.build.hooks.vcs]
|
[tool.hatch.build.hooks.vcs]
|
||||||
version-file = "brewman/_version.py"
|
version-file = "brewman/_version.py"
|
||||||
|
|||||||
Reference in New Issue
Block a user