mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Merge pull request #281 from mchangrh/docker/node-14
multi-stage dockerfile with node:14-alpine
This commit is contained in:
commit
f1d22c6ca4
2 changed files with 11 additions and 10 deletions
19
Dockerfile
19
Dockerfile
|
@ -1,13 +1,14 @@
|
|||
FROM node:14
|
||||
WORKDIR /usr/src/app
|
||||
COPY package.json .
|
||||
COPY package-lock.json .
|
||||
COPY tsconfig.json .
|
||||
FROM node:14-alpine as builder
|
||||
RUN apk add --no-cache --virtual .build-deps python make g++
|
||||
COPY package.json package-lock.json tsconfig.json entrypoint.sh ./
|
||||
COPY src src
|
||||
RUN npm ci
|
||||
RUN npm run tsc
|
||||
RUN mkdir databases
|
||||
COPY databases/*.sql databases/
|
||||
RUN npm ci && npm run tsc
|
||||
|
||||
FROM node:14-alpine as app
|
||||
WORKDIR /usr/src/app
|
||||
COPY --from=builder node_modules .
|
||||
COPY --from=builder dist ./dist
|
||||
COPY entrypoint.sh .
|
||||
COPY databases/*.sql databases/
|
||||
EXPOSE 8080
|
||||
CMD ./entrypoint.sh
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
set -e
|
||||
echo 'Entrypoint script'
|
||||
cd /usr/src/app
|
||||
|
|
Loading…
Reference in a new issue