-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
52 lines (38 loc) · 1.3 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
51
52
FROM node:21.7.1-alpine AS cssbuild
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm
RUN pnpm install
COPY sortiment ./sortiment
COPY tailwind.config.js ./
RUN pnpm run prod
CMD ["pnpm", "run", "dev"]
FROM python:3.12-slim-bookworm
WORKDIR /app
RUN useradd --create-home appuser
ENV PYTHONUNBUFFERED 1
ENV PYTHONFAULTHANDLER 1
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt update \
&& apt install -y caddy xz-utils \
&& apt -y upgrade \
&& apt -y clean \
&& rm -rf /var/lib/apt/lists/*
ARG MULTIRUN_VERSION=1.1.3
ADD https://github.com/nicolas-van/multirun/releases/download/${MULTIRUN_VERSION}/multirun-x86_64-linux-gnu-${MULTIRUN_VERSION}.tar.gz /tmp
RUN tar -xf /tmp/multirun-x86_64-linux-gnu-${MULTIRUN_VERSION}.tar.gz \
&& mv multirun /bin \
&& rm /tmp/*
RUN chown appuser:appuser /app
ENV POETRY_VIRTUALENVS_CREATE 0
RUN pip install --upgrade poetry
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root
USER appuser
COPY sortiment ./sortiment
COPY --from=cssbuild /app/sortiment/static/* /app/sortiment/static/
COPY docker/start.sh /app/start.sh
COPY docker/Caddyfile /app/Caddyfile
WORKDIR /app/sortiment
RUN python manage.py collectstatic --no-input
CMD ["/bin/multirun", "caddy run --adapter caddyfile --config /app/Caddyfile", "/app/start.sh"]