forked from kikoeru-project/kikoeru-express
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
38 lines (28 loc) · 943 Bytes
/
Dockerfile
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
29
30
31
32
33
34
35
36
37
38
# This dockerfile generates a single-container application
# It copies build artifacts the from front-end image
# If you want to separate the front-end from the back-end, it should work as well
FROM node:14-alpine as build-dep
# Create app directory
WORKDIR /usr/src/kikoeru
RUN apk update && apk add python make gcc g++
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm ci --only=production
# Final stage
FROM node:14-alpine
ENV IS_DOCKER=true
WORKDIR /usr/src/kikoeru
# Copy build artifacts
COPY --from=build-dep /usr/src/kikoeru /usr/src/kikoeru
COPY dist /usr/src/kikoeru/dist
# Bundle app source
COPY . .
# Tini
RUN apk add --no-cache tini
ENTRYPOINT ["/sbin/tini", "--"]
# 持久化
VOLUME [ "/usr/src/kikoeru/sqlite", "/usr/src/kikoeru/config", "/usr/src/kikoeru/covers"]
EXPOSE 6789
CMD [ "node", "app.js" ]