-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile.node14
52 lines (43 loc) · 1.4 KB
/
Dockerfile.node14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM node:14-slim as base
FROM base as builder
ENV VOLTO_MAJOR=13
ENV VOLTO_MINOR=15
ENV VOLTO_PATCH=1
ENV VOLTO_PRERELEASE=
ENV VOLTO_VERSION=${VOLTO_MAJOR}.${VOLTO_MINOR}.${VOLTO_PATCH}${VOLTO_PRERELEASE}
RUN apt-get update \
&& buildDeps="python3 build-essential" \
&& apt-get install -y --no-install-recommends $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir build && chown -R node:node build \
&& npm install --no-audit --no-fund -g yo @plone/generator-volto
USER node
WORKDIR /build
# Generate new volto app
RUN yo @plone/volto \
plone-frontend \
--description "Plone frontend using Volto" \
--skip-addons \
--skip-install \
--skip-workspaces \
--volto=${VOLTO_VERSION} \
--no-interactive
RUN cd plone-frontend \
&& yarn install --prod \
&& yarn build
FROM base
LABEL maintainer="Plone Community <dev@plone.org>" \
org.label-schema.name="plone-frontend" \
org.label-schema.description="Plone frontend image" \
org.label-schema.vendor="Plone Foundation" \
org.label-schema.docker.cmd="docker run -d -p 3000:3000 plone/plone-frontend:13.15.1"
RUN apt-get update \
&& buildDeps="busybox" \
&& apt-get install -y --no-install-recommends $buildDeps \
&& busybox --install -s \
&& rm -rf /var/lib/apt/lists/*
USER node
COPY --from=builder /build/plone-frontend/ /app/
WORKDIR /app
EXPOSE 3000
CMD ["yarn", "start:prod"]