|
@@ -29,17 +29,6 @@ RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-##
|
|
|
|
|
-## deps-resolver-prod
|
|
|
|
|
-##
|
|
|
|
|
-FROM deps-resolver AS deps-resolver-prod
|
|
|
|
|
-
|
|
|
|
|
-# shrink dependencies for production
|
|
|
|
|
-RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
|
|
|
- yarn install --production
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
##
|
|
##
|
|
|
## prebuilder-default
|
|
## prebuilder-default
|
|
|
##
|
|
##
|
|
@@ -48,14 +37,7 @@ LABEL maintainer Yuki Takei <yuki@weseek.co.jp>
|
|
|
|
|
|
|
|
ENV appDir /opt/growi
|
|
ENV appDir /opt/growi
|
|
|
|
|
|
|
|
-COPY bin ${appDir}/bin
|
|
|
|
|
-COPY config ${appDir}/config
|
|
|
|
|
-COPY public ${appDir}/public
|
|
|
|
|
-COPY resource ${appDir}/resource
|
|
|
|
|
-COPY src ${appDir}/src
|
|
|
|
|
-COPY tmp ${appDir}/tmp
|
|
|
|
|
-COPY babel.config.js package.json yarn.lock ${appDir}/
|
|
|
|
|
-COPY *.md LICENSE ${appDir}/
|
|
|
|
|
|
|
+COPY . ${appDir}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -83,11 +65,14 @@ WORKDIR ${appDir}
|
|
|
# build
|
|
# build
|
|
|
RUN yarn build:prod
|
|
RUN yarn build:prod
|
|
|
|
|
|
|
|
|
|
+# shrink dependencies for production
|
|
|
|
|
+RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
|
|
|
+ yarn install --production
|
|
|
|
|
+
|
|
|
# remove unnecessary files
|
|
# remove unnecessary files
|
|
|
-RUN rm -rf bin
|
|
|
|
|
-RUN rm -rf node_modules
|
|
|
|
|
-RUN rm -rf src/client src/linter-checker src/test
|
|
|
|
|
-RUN rm -rf babel.config.js
|
|
|
|
|
|
|
+WORKDIR /tmp
|
|
|
|
|
+RUN --mount=target=. sh docker/bin/remove-unnecessary-files.sh
|
|
|
|
|
+WORKDIR ${appDir}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -104,8 +89,6 @@ RUN --mount=type=cache,target=/var/cache/apk \
|
|
|
apk add tini
|
|
apk add tini
|
|
|
|
|
|
|
|
COPY docker/docker-entrypoint.sh /
|
|
COPY docker/docker-entrypoint.sh /
|
|
|
-COPY --from=deps-resolver-prod --chown=node:node \
|
|
|
|
|
- ${appDir}/node_modules ${appDir}/node_modules
|
|
|
|
|
COPY --from=builder --chown=node:node \
|
|
COPY --from=builder --chown=node:node \
|
|
|
${appDir} ${appDir}
|
|
${appDir} ${appDir}
|
|
|
|
|
|