-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathDockerfile
46 lines (32 loc) · 1.26 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
FROM node:12-alpine as builder
WORKDIR /app
COPY ./builder/package.json ./builder/yarn.lock /app/
RUN yarn install --frozen-lockfile
COPY ./builder /app
RUN yarn run build
FROM python:3.8-slim-buster@sha256:2516c4bc037b8144b6104e73e6bdd0c861725d9ed7bd05095dded22842991508
LABEL org.opencontainers.image.source="https://github.com/thunderstore-io/Thunderstore"
ARG BUILD_INSTALL_EXTRAS
ENV PYTHONUNBUFFERED 1
ENV DB_CERT_DIR /etc/ssl/private/db-certs/
WORKDIR /app
RUN apt-get update && apt-get install -y \
curl build-essential git \
&& rm -rf /var/lib/apt/lists/*
COPY ./python-packages/ /python-packages
COPY ./django/pyproject.toml ./django/poetry.lock /app/
RUN pip install -U pip setuptools wheel virtualenv==20.7.2 poetry~=1.4.2 --no-cache-dir && \
poetry config virtualenvs.create false && \
poetry config installer.max-workers 1 && \
if [ $BUILD_INSTALL_EXTRAS = true ] ; then \
poetry install --with plugins ; \
else \
poetry install ; \
fi && \
rm -rf ~/.cache
COPY --from=builder /app/build /app/static_built
COPY ./django /app
RUN SECRET_KEY=x python manage.py collectstatic --noinput
HEALTHCHECK --interval=5s --timeout=8s --retries=3 \
CMD python readycheck.py || exit 1
ENTRYPOINT ["python", "/app/docker_entrypoint.py"]