Bor Hodošček commited on
Commit
bce3284
·
1 Parent(s): f568f7f

chore: update dockerfile and deps

Browse files
Files changed (5) hide show
  1. .dockerignore +1 -0
  2. Dockerfile +15 -7
  3. app.py +1 -1
  4. pyproject.toml +2 -2
  5. uv.lock +0 -0
.dockerignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .venv
Dockerfile CHANGED
@@ -1,5 +1,4 @@
1
- FROM python:3.12-slim
2
- COPY --from=ghcr.io/astral-sh/uv:0.7.13 /uv /bin/uv
3
 
4
  RUN useradd -m -u 1000 user
5
  ENV PATH="/home/user/.local/bin:$PATH"
@@ -7,16 +6,25 @@ ENV UV_SYSTEM_PYTHON=1
7
 
8
  WORKDIR /app
9
 
10
- RUN apt update && apt install -y curl unzip gcc g++
11
- RUN mkdir -p /app && chown -R user:user /app
 
12
 
13
- COPY --chown=user ./pyproject.toml ./uv.lock ./app.py ./*.txt /app
 
14
 
15
  RUN chmod -R u+w /app
16
 
17
  USER user
18
 
19
- RUN curl -O https://clrd.ninjal.ac.jp/unidic_archive/2308/unidic-novel-v202308.zip && unzip -x unidic-novel-v202308.zip
20
- RUN uv sync
 
 
 
 
 
 
 
21
 
22
  CMD ["uv", "run", "marimo", "run", "app.py", "--no-sandbox", "--include-code", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM ghcr.io/astral-sh/uv:0.9.5-python3.12-trixie-slim
 
2
 
3
  RUN useradd -m -u 1000 user
4
  ENV PATH="/home/user/.local/bin:$PATH"
 
6
 
7
  WORKDIR /app
8
 
9
+ RUN apt update && apt install -y --no-install-recommends curl unzip \
10
+ && rm -rf /var/lib/apt/lists/*
11
+ RUN chown -R user:user /app
12
 
13
+ COPY --chown=user pyproject.toml uv.lock /app/
14
+ COPY --chown=user app.py ./*.txt /app/
15
 
16
  RUN chmod -R u+w /app
17
 
18
  USER user
19
 
20
+ RUN uv sync --locked
21
+
22
+ RUN curl -fsSL -o unidic.zip https://clrd.ninjal.ac.jp/unidic_archive/2308/unidic-novel-v202308.zip \
23
+ && unzip -q unidic.zip \
24
+ && rm -f unidic.zip
25
+
26
+ EXPOSE 7860
27
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=30s \
28
+ CMD curl -f http://localhost:7860/ || exit 1
29
 
30
  CMD ["uv", "run", "marimo", "run", "app.py", "--no-sandbox", "--include-code", "--host", "0.0.0.0", "--port", "7860"]
app.py CHANGED
@@ -11,7 +11,7 @@
11
  # "pyarrow",
12
  # "scattertext==0.2.2",
13
  # "scikit-learn==1.7.0",
14
- # "scipy==1.13.1",
15
  # ]
16
  # ///
17
 
 
11
  # "pyarrow",
12
  # "scattertext==0.2.2",
13
  # "scikit-learn==1.7.0",
14
+ # "scipy>=1.13.1",
15
  # ]
16
  # ///
17
 
pyproject.toml CHANGED
@@ -14,6 +14,6 @@ dependencies = [
14
  "pandas>=2.3.0",
15
  "pyarrow>=20.0.0",
16
  "scattertext==0.2.2",
17
- "scikit-learn==1.7.0",
18
- "scipy==1.13.1",
19
  ]
 
14
  "pandas>=2.3.0",
15
  "pyarrow>=20.0.0",
16
  "scattertext==0.2.2",
17
+ "scikit-learn>=1.7.0",
18
+ "scipy>=1.13.1",
19
  ]
uv.lock CHANGED
The diff for this file is too large to render. See raw diff