mirror of
https://github.com/zadam/trilium.git
synced 2025-02-26 16:15:19 +08:00
Smaller Docker image by switching the base image to node:10.13.0-alpine and consolidating scripts
This commit is contained in:
parent
e37dd69827
commit
9cb9ea6ab5
1 changed files with 16 additions and 10 deletions
26
Dockerfile
26
Dockerfile
|
@ -1,21 +1,27 @@
|
|||
FROM node:10.13.0
|
||||
|
||||
RUN apt-get update && apt-get install -y nasm
|
||||
FROM node:10.13.0-alpine
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install app dependencies
|
||||
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||
# Copy both package.json and package-lock.json
|
||||
# where available (npm@5+)
|
||||
COPY package*.json ./
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
RUN npm install --production
|
||||
# If you are building your code for production
|
||||
# RUN npm install --only=production
|
||||
# Install app dependencies
|
||||
RUN set -x \
|
||||
&& apk add --no-cache --virtual .build-dependencies \
|
||||
autoconf \
|
||||
automake \
|
||||
g++ \
|
||||
gcc \
|
||||
libtool \
|
||||
make \
|
||||
nasm \
|
||||
&& npm install --production \
|
||||
&& apk del .build-dependencies
|
||||
|
||||
# Bundle app source
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8080
|
||||
CMD [ "node", "src/www" ]
|
||||
CMD [ "node", "./src/www" ]
|
||||
|
|
Loading…
Reference in a new issue