-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile-allinone
More file actions
60 lines (49 loc) · 1.27 KB
/
Copy pathDockerfile-allinone
File metadata and controls
60 lines (49 loc) · 1.27 KB
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
58
59
60
FROM node:23.5.0-alpine as builder-front
RUN apk add --update --no-cache yarn python3 make gcc g++ \
&& rm -rf /var/cache/apk/*
ADD ./front/ /front/
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN \
echo 'building frontend' && \
cd /front/ && \
yarn install && \
yarn build
FROM alpine:3.21 as builder-backend
RUN \
echo 'installing dependencies' && \
apk add --no-cache \
bash \
git \
musl-dev \
gcc \
rust cargo \
libffi libffi-dev \
postgresql-dev \
python3-dev \
python3 \
py3-pip \
py3-psycopg2 \
py3-virtualenv \
make \
zlib-dev \
jpeg-dev \
libmagic
ADD ./api/ /app/api/
ADD ./setup-data/ /app/setup-data/
# hack around https://github.com/pypa/pip/issues/6158#issuecomment-456619072
ENV PIP_DOWNLOAD_CACHE=/noop/
RUN \
echo 'installing pip requirements' && \
python -m virtualenv /venv && \
/venv/bin/pip install --upgrade pip && \
/venv/bin/pip install setuptools wheel && \
/venv/bin/pip install -r /app/api/requirements.txt && \
rm -rf $PIP_DOWNLOAD_CACHE
COPY --from=builder-front /front/dist /app/front
RUN mkdir /uploads /statics
VOLUME /uploads
VOLUME /statics
EXPOSE 8000
WORKDIR /app/api/
ENTRYPOINT ["./docker/entrypoint.sh"]
CMD ["./docker/server.sh"]