-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
43 lines (36 loc) · 1.24 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
FROM python:3.10.1-alpine as base
WORKDIR /usr/src/app
FROM node:20.12-alpine as dashboard
WORKDIR /usr/src/app
RUN npm install [email protected] -g
COPY apps/dashboard/package.json apps/dashboard/pnpm-lock.yaml ./
RUN pnpm install
COPY apps/dashboard ./
RUN pnpm build-prod
FROM base as frontend
RUN apk add npm
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM base as backend
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN apk update \
&& apk add --no-cache gcc python3-dev musl-dev libffi-dev \
gdal-dev linux-headers g++ binutils geos-dev \
tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \
libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev libimagequant-dev \
libxcb-dev libpng-dev libpq-dev
RUN pip install --upgrade pip==21.3.1
COPY ./requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN sed -i 's/\r$//g' /usr/src/app/entrypoint.sh
RUN chmod +x /usr/src/app/entrypoint.sh
COPY --from=frontend /usr/src/app/webpack-stats.js ./
COPY --from=frontend /usr/src/app/ais_static/bundles ./ais_static/bundles
RUN mkdir -p /usr/src/app/ais_static/apps/dashboard
COPY --from=dashboard /usr/src/app/dist ./ais_static/apps/dashboard
ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
EXPOSE 3000