diff options
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..31b60f5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +# Stage 1. Base +FROM node:carbon AS base +WORKDIR /app + +# Stage 2. Dependencies +FROM base AS dependencies +COPY package*.json ./ +RUN npm install + +# Stage 3. TS compilation +FROM dependencies AS build +COPY src /app/src +COPY tsconfig.json /app +RUN npm run tsc + +# Stage 4. Release Image +FROM node:alpine AS release +WORKDIR /app + +COPY --from=dependencies /app/package.json ./ +RUN npm install --only=production +COPY --from=build /app/build ./build +COPY public ./public + +ENV NODE_ENV=production \ + PORT=8080 \ + BIND_ADDRESS=0.0.0.0 \ + UPLOAD_LIMIT=134217700 \ + LOG_LEVEL=info \ + HOST_DIR=/data + +RUN mkdir -p ${HOST_DIR} +VOLUME [ ${HOST_DIR} ] +EXPOSE ${PORT} + +CMD [ "node", "./build/index.js" ]
\ No newline at end of file |
