-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
58 lines (33 loc) · 1003 Bytes
/
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
51
52
53
54
55
56
57
58
# Production Dockerfile for application
FROM node:22-bookworm-slim AS frontend
WORKDIR /app
# Asset requirements
COPY package*.json ./
RUN npm install
# Build assets
COPY . /app
ENV NODE_ENV=production
RUN npm run build && rm -rf node_modules
# Python
FROM python:3.12.4-bookworm AS backend
ENV PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONFAULTHANDLER=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_ROOT_USER_ACTION=ignore
WORKDIR /app
# Python requirements
COPY ./requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
# Download NLTK files
COPY ./nltk.txt /app/nltk.txt
RUN xargs -I{} python -c "import nltk; nltk.download('{}')" < /app/nltk.txt
# Copy over files
COPY . /app
# Build and copy over assets
COPY --from=frontend /app/assets /app/assets
# Collect static files for Whitenoise
RUN python manage.py collectstatic --no-input --traceback