2021-10-15 16:01:52 +02:00
|
|
|
FROM node:lts-alpine AS builder
|
2021-10-15 15:49:55 +02:00
|
|
|
|
2021-06-24 17:22:00 +02:00
|
|
|
# needed for native packages (bcrypt, canvas)
|
2021-10-15 15:49:55 +02:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
make \
|
|
|
|
gcc \
|
|
|
|
g++ \
|
|
|
|
python \
|
|
|
|
cairo-dev \
|
|
|
|
jpeg-dev \
|
|
|
|
pango-dev \
|
|
|
|
giflib-dev
|
|
|
|
|
2021-10-15 16:01:52 +02:00
|
|
|
WORKDIR /usr/src/api
|
2021-10-15 15:49:55 +02:00
|
|
|
|
|
|
|
RUN npm rebuild bcrypt --build-from-source \
|
|
|
|
&& npm install canvas --build-from-source
|
|
|
|
|
|
|
|
COPY api/package.json api/package-lock.json ./
|
|
|
|
COPY util ../util
|
2021-10-15 16:01:52 +02:00
|
|
|
RUN cd ../util && npm install && cd ../api && npm install
|
2021-10-15 15:49:55 +02:00
|
|
|
|
|
|
|
COPY api/ .
|
|
|
|
|
2021-10-17 02:12:10 +02:00
|
|
|
RUN npm run build
|
2021-10-15 15:49:55 +02:00
|
|
|
|
2021-05-23 03:28:19 +02:00
|
|
|
EXPOSE 3001
|
2021-10-17 23:51:17 +02:00
|
|
|
|
2021-07-28 00:55:59 +02:00
|
|
|
CMD ["node", "dist/start.js"]
|