-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (41 loc) · 1.86 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (41 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM ghcr.io/astral-sh/uv:debian-slim
# Install curl, CA certs, and spatial libraries for GeoDjango
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ca-certificates \
libsqlite3-mod-spatialite \
libgeos-dev \
libproj-dev \
libgdal-dev \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy the full application code (required since project is installable)
COPY . .
# Install Python dependencies using uv (creates .venv) after code is present
RUN uv sync --frozen
ENV PATH="/app/.venv/bin:$PATH"
# Download Tailwind CSS standalone binary and build CSS in one step
RUN curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 \
&& chmod +x tailwindcss-linux-x64 \
&& rm -f ./snorkelforecast/static/css/output.css \
&& ./tailwindcss-linux-x64 -i ./snorkelforecast/static/src/input.css -o ./snorkelforecast/static/css/output.css --minify \
&& rm tailwindcss-linux-x64
# Fetch and vendor Chart.js locally for self-hosting (place in root static/ so collectstatic picks it up)
RUN mkdir -p ./static/js \
&& curl -fSL https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js -o ./static/js/chart.umd.min.js
# Create logs directory for Django logging
RUN mkdir -p logs
# Make startup script executable
RUN chmod +x startup.sh
# NOTE: We intentionally do NOT run test_osm_import.py here. It imports Django
# models before settings are configured (raising ImproperlyConfigured) and needs
# a migrated DB + network — none of which exist at image-build time. As a `RUN`
# step it failed every build, which silently broke Coolify deploys (the old
# container kept serving). Tests run in CI (.github/workflows/ci.yml) instead.
# Expose port
EXPOSE 8000
# Run startup script
CMD ["./startup.sh"]