mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
Merge pull request #983 from vector-im/hughns/docker-deps-layer
Install npm deps in separate docker layer
This commit is contained in:
commit
86ce54d69c
11
Dockerfile
11
Dockerfile
@ -1,9 +1,14 @@
|
|||||||
FROM docker.io/node:alpine as builder
|
FROM docker.io/node:alpine as builder
|
||||||
RUN apk add --no-cache git python3 build-base
|
RUN apk add --no-cache git python3 build-base
|
||||||
COPY . /app
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN yarn install \
|
|
||||||
&& yarn build
|
# Copy package.json and yarn.lock and install dependencies first to speed up subsequent builds
|
||||||
|
COPY package.json yarn.lock /app/
|
||||||
|
RUN yarn install
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
FROM docker.io/nginx:alpine
|
FROM docker.io/nginx:alpine
|
||||||
|
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
FROM docker.io/node:alpine
|
FROM docker.io/node:alpine
|
||||||
RUN apk add --no-cache git python3 build-base
|
RUN apk add --no-cache git python3 build-base
|
||||||
COPY . /code
|
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
|
|
||||||
|
# Copy package.json and yarn.lock and install dependencies first to speed up subsequent builds
|
||||||
|
COPY package.json yarn.lock /code/
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
|
|
||||||
|
COPY . /code
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENTRYPOINT ["yarn", "start"]
|
ENTRYPOINT ["yarn", "start"]
|
||||||
|
Loading…
Reference in New Issue
Block a user