* optimizing frontend dockerfile: - run install first to cache node_modules - don't pass node_modules to image - add only needed files before build * remove language file generation from build step Co-authored-by: sua yoo <sua@suayoo.com>
23 lines
392 B
Docker
23 lines
392 B
Docker
FROM node:16 as build
|
|
|
|
WORKDIR /app
|
|
COPY package.json .
|
|
COPY yarn.lock .
|
|
RUN yarn --frozen-lockfile
|
|
COPY *.* ./
|
|
COPY src ./src/
|
|
COPY scripts ./scripts/
|
|
RUN yarn build
|
|
|
|
|
|
FROM nginx
|
|
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
|
|
COPY ./nginx.conf.template /etc/nginx/templates/
|
|
|
|
RUN rm /etc/nginx/conf.d/*
|
|
|
|
RUN mkdir -p /etc/nginx/resolvers; echo "" > /etc/nginx/resolvers/resolvers.conf
|
|
|