diff options
author | Samuel <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-17 23:54:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-17 23:54:17 +0200 |
commit | f6b08b84a15b73d34aed543decb0e2f1ac6b9cdc (patch) | |
tree | 58c3f963faf5c9076a3b9b354f3943b773492c30 /api | |
parent | Merge branch 'master' of http://github.com/fosscord/fosscord-server (diff) | |
parent | Merge branch 'hbjydev-docker-fix' (diff) | |
download | server-f6b08b84a15b73d34aed543decb0e2f1ac6b9cdc.tar.xz |
Merge pull request #477 from DiegoMagdaleno/master
Diffstat (limited to 'api')
-rw-r--r-- | api/Dockerfile | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/api/Dockerfile b/api/Dockerfile index 16443b15..41c9363b 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,12 +1,29 @@ -FROM node:lts-alpine +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/fosscord-server -COPY package.json . -COPY package-lock.json . -RUN npm rebuild bcrypt --build-from-source && npm install canvas --build-from-source -RUN npm install -COPY . . -EXPOSE 3001 +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"] |