Skip to content

Commit

Permalink
Merge pull request #45 from a5chin/feature/docker
Browse files Browse the repository at this point in the history
fix docker
  • Loading branch information
a5chin authored Dec 15, 2024
2 parents 7981c79 + 71f65f9 commit 515f116
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 10 deletions.
11 changes: 10 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG UV_VERSION=0.5.4
ARG UV_VERSION=0.5.9
ARG DEBIAN_VERSION=bookworm


Expand All @@ -8,4 +8,13 @@ FROM ghcr.io/astral-sh/uv:$UV_VERSION AS uv
FROM mcr.microsoft.com/vscode/devcontainers/base:$DEBIAN_VERSION
LABEL maintainer="a5chin <a5chin.origin+contact@gmain.com>"

# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
# For OpenCV etc...
libgl1 libglib2.0-0 \
# To remove the image size, it is recommended refresh the package cache as follows
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY --from=uv --chown=vscode: /uv /uvx /bin/
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"context": "..",
"dockerfile": "Dockerfile",
"args": {
"UV_VERSION": "0.5.4",
"UV_VERSION": "0.5.9",
"DEBIAN_VERSION": "bookworm"
}
},
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2

updates:
- package-ecosystem: pip
directory: "/"
directory: /
schedule:
interval: daily
commit-message:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default_stages: [commit]
default_stages: [pre-commit]

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG DEBIAN_VERSION=bookworm
ARG UV_VERSION=0.5.4
ARG UV_VERSION=0.5.9
ARG VARIANT=3.12


Expand All @@ -9,13 +9,22 @@ FROM ghcr.io/astral-sh/uv:$UV_VERSION AS uv
FROM python:$VARIANT-slim-$DEBIAN_VERSION
LABEL maintainer="a5chin <a5chin.origin+contact@gmain.com>"

ENV PYTHONDONTWRITEBYTECODE=True
ENV PYTHONUNBUFFERED=True
ENV UV_LINK_MODE=copy

WORKDIR /app

COPY --from=uv /uv /uvx /bin/
COPY pyproject.toml uv.lock ./

ENV PYTHONDONTWRITEBYTECODE=True
ENV PYTHONUNBUFFERED=True
ENV UV_LINK_MODE=copy

# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
# For OpenCV etc...
libgl1 libglib2.0-0 \
# To remove the image size, it is recommended refresh the package cache as follows
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN uv sync --frozen --no-install-project
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ requires-python = ">=3.9"
readme = "README.md"
license = { file = "LICENSE" }

dependencies = []
dependencies = [
"pydantic>=2.10.3",
]

[tool.uv]
dev-dependencies = [
Expand Down
138 changes: 138 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 515f116

Please sign in to comment.