-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
57 lines (38 loc) · 1.09 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
53
54
55
56
57
FROM python:3.10-slim AS poetry-builder
ENV POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_NO_INTERACTION=1
ENV PATH="$POETRY_HOME/bin:$PATH"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
build-essential \
libpq-dev \
&& curl -sSL https://install.python-poetry.org | python3 -
WORKDIR /app
COPY poetry.lock pyproject.toml ./
RUN poetry install --no-root --no-ansi
FROM node:18.16 as node-builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY esbuild.mjs ./
COPY frontend ./frontend
RUN npm run build
RUN ls -la
FROM python:3.10-slim
# Needed at runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpq-dev
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH="/app/.venv/bin:$PATH"
WORKDIR /app
COPY --from=node-builder /app/build /app/build
COPY --from=poetry-builder /app/.venv ./.venv
ADD uchan /app/uchan
ADD docker /app/docker
ADD migrations /app/migrations
ADD alembic.ini /app/
ENTRYPOINT ["/app/docker/docker-entrypoint.sh"]