summary refs log tree commit diff
path: root/api/Dockerfile
blob: dbe21e1586e20838ba28024dba9f9eeacd3c8b13 (plain) (blame)
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
FROM node:lts-alpine AS builder

# needed for native packages (bcrypt, canvas)
RUN apk add --no-cache \
    make \
    gcc \
    g++ \
    python \
    cairo-dev \
    jpeg-dev \
    pango-dev \
    giflib-dev

WORKDIR /usr/src/api

RUN npm rebuild bcrypt --build-from-source \
    && npm install canvas --build-from-source

COPY api/package.json api/package-lock.json ./
COPY util ../util
RUN cd ../util && npm install && cd ../api && npm install

COPY api/ .

RUN npm run build

EXPOSE 3001
CMD ["node", "dist/start.js"]