bc2e7a7366
So far, the Dockerfile built hydrogen on the server running the image, instead of building it during the building of the image. This blew up the image size immensely and caused node+yarn to run in the resulting image. This new Dockerfile builds hydrogen in a separate build stage and then moves the target directory into an nginx based container image, which takes care of serving the target webroot. The existing Dockerfile has been moved to Dockerfile-dev for usage as a development environment. The docs have been adjusted accordingly. Additionally, this switched from a fixed alpine version of the node image to the latest alpine version, and changed the container image references in the `FROM` statements to use the fully qualified references including the registry domain.
9 lines
207 B
Docker
9 lines
207 B
Docker
FROM docker.io/node:alpine as builder
|
|
RUN apk add --no-cache git
|
|
COPY . /app
|
|
WORKDIR /app
|
|
RUN yarn install \
|
|
&& yarn build
|
|
|
|
FROM docker.io/nginx:alpine
|
|
COPY --from=builder /app/target /usr/share/nginx/html
|