forked from TechFrederick/community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (32 loc) · 1.03 KB
/
Dockerfile
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
FROM node:18 AS nodejs
WORKDIR /app
COPY frontend/package.json frontend/package-lock.json ./
RUN --mount=type=cache,target=/root/.npm \
npm install --loglevel verbose
COPY frontend frontend/
COPY templates templates/
COPY techcity/core/frontend.py techcity/core/
RUN npm --prefix frontend run css
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_PROJECT_ENVIRONMENT=/usr/local
COPY --from=ghcr.io/astral-sh/uv:0.4.7 /uv /bin/uv
WORKDIR /app
RUN addgroup --gid 222 --system app \
&& adduser --uid 222 --system --group app
RUN mkdir -p /app && chown app:app /app
COPY --chown=app:app pyproject.toml uv.lock /app/
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
COPY --chown=app:app . /app/
COPY --from=nodejs /app/static/site.css static/
RUN \
SECRET_KEY=builder-secret \
SENTRY_DSN=dsn-dummy \
SENTRY_ENABLED=False \
python manage.py collectstatic --noinput
USER app
ENTRYPOINT ["/app/bin/docker-entrypoint"]
EXPOSE 8000
CMD ["/app/bin/server"]