mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 02:55:04 +01:00
Install npm deps in separate docker layer
This commit is contained in:
parent
a565d2a7d3
commit
6fa73ec214
11
Dockerfile
11
Dockerfile
@ -1,9 +1,14 @@
|
||||
FROM docker.io/node:alpine as builder
|
||||
RUN apk add --no-cache git python3 build-base
|
||||
COPY . /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
|
||||
COPY --from=builder /app/target /usr/share/nginx/html
|
||||
|
@ -1,7 +1,12 @@
|
||||
FROM docker.io/node:alpine
|
||||
RUN apk add --no-cache git python3 build-base
|
||||
COPY . /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
|
||||
|
||||
COPY . /code
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["yarn", "start"]
|
||||
|
Loading…
Reference in New Issue
Block a user