Skip to content

Commit

Permalink
Generate assets during build
Browse files Browse the repository at this point in the history
Add an additional node image that is responsible for generating the CSS
and assets during build, which can then be copied into the build and
service stages.
  • Loading branch information
opdavies committed Sep 13, 2021
1 parent 122bc4b commit d60bf53
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 50,883 deletions.
20 changes: 19 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
ARG NODE_VERSION=14

# A node container for generating the CSS and JS assets for the site, copying
# in only the minimal files that are needed to do this. Once this is done, the
# node dependencies can be installed using yarn, and Encore can be run to
# generate the assets.
FROM node:${NODE_VERSION} AS assets
WORKDIR /app
COPY package.json .
COPY yarn.lock .
COPY webpack.config.js .
COPY source source
RUN yarn install --frozen-lockfile

FROM assets AS assets-build
RUN yarn encore dev

FROM opdavies/sculpin AS sculpin
COPY composer.* ./
WORKDIR /app/source
COPY --from=assets-build /app/source/build build

FROM opdavies/sculpin-serve AS sculpin-watch
COPY --from=sculpin /app .
COPY . .

Loading

0 comments on commit d60bf53

Please sign in to comment.