Skip to content

Public/static directory lost in multistage docker build. What build assets to copy? #13304

Answered by malimccalla
malimccalla asked this question in Help
Discussion options

You must be logged in to vote

Solved my issue. I needed to copy over the public directory as well, i just assumed it would be built with the project. For anyone that may find it helpful, here is my final working Dockerfile (I have a yarn workspace)

## BUILD PHASE ##
FROM node:latest as builder
WORKDIR /app

COPY ./lerna.json .
COPY ./package.json .
COPY ./yarn.lock .
COPY ./tsconfig.json .
COPY ./packages/www/package.json ./packages/www/package.json
COPY ./packages/shared/package.json ./packages/shared/package.json

# Will use cache unless any of the above files have changed
RUN yarn install

# Copy the source code to be built
COPY ./packages/www/ ./packages/www/
COPY ./packages/shared/ ./packages/shared/

RUN yarn ru…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by malimccalla
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants