-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
48 lines (37 loc) · 1.14 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
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION
FROM node:16 as frontend
WORKDIR /frontend
COPY package-lock.json package.json ./
RUN npm install
COPY vite.config.js ./
COPY frontend ./frontend
RUN npm run build
FROM python:${PYTHON_VERSION}-alpine
ENV PIP_NO_CACHE_DIR off
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY requirements.txt ./
# hadolint ignore=DL3018
RUN \
set -ex; \
apk add --no-cache tini postgresql-libs jpeg-dev && \
apk add --no-cache --virtual build-dependencies curl postgresql-dev libstdc++ zlib-dev build-base && \
pip install --no-cache-dir -r requirements.txt && \
apk del build-dependencies && \
find /usr/local -depth -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -exec rm -rf '{}' +;
# User-accessible environment
ENV ENVIRONMENT=PRODUCTION
ENV DJANGO_ALLOWED_HOSTS=127.0.0.1
COPY Procfile ./
COPY manage.py ./
COPY bin ./bin
COPY --from=frontend /frontend/frontend/dist ./frontend/dist
COPY tapedrive ./tapedrive
COPY listeners ./listeners
COPY podcasts ./podcasts
RUN python manage.py collectstatic --no-input
EXPOSE 8273
VOLUME /app /data
ENTRYPOINT [ "tini", "--", "./bin/entrypoint.sh" ]
CMD ["honcho", "start"]