-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (31 loc) · 1.21 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
# Stage 1
FROM --platform=linux/amd64 9555v10x.gra7.container-registry.ovh.net/gpf-dockerhub/nikolaik/python-nodejs:python3.10-nodejs20-slim AS build
WORKDIR /app
RUN apt-get update && apt-get install -y build-essential gcc
RUN corepack disable && npm install -g yarn
COPY package.json yarn.lock ./
RUN yarn install --prod --frozen-lockfile
COPY requirements.txt ./
RUN pip install --user -r requirements.txt
# Stage 2
FROM --platform=linux/amd64 redis:7.0 AS redis
# Stage 3
FROM --platform=linux/amd64 9555v10x.gra7.container-registry.ovh.net/gpf-dockerhub/nikolaik/python-nodejs:python3.10-nodejs20-slim
WORKDIR /app
COPY --from=redis /usr/local/bin/redis-server /usr/local/bin/redis-server
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /root/.local /root/.local
RUN apt-get update && \
apt-get install -y p7zip-full curl wget && \
wget -q https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && \
chmod +x /usr/bin/yq && \
rm -rf /var/lib/apt/lists/*
RUN corepack disable && npm install -g yarn
COPY . .
ENV PATH=/root/.local/bin:$PATH
ENV NODE_ENV production
ENV TMP_PATH /tmp
ENV DATA_PATH /data
ENV PORT 3000
EXPOSE 3000
CMD ["yarn", "start"]