Browse Source

chore: use `COPY --link` in Dockerfiles

cf. https://docs.docker.com/reference/dockerfile/#copy---link
pull/8494/head
Salim B 2 months ago
parent
commit
30fe1f0ff6
No known key found for this signature in database
GPG Key ID: C7657487017FE6D5
  1. 17
      packages/nocodb/Dockerfile
  2. 14
      packages/nocodb/Dockerfile.local
  3. 21
      packages/nocodb/litestream/Dockerfile

17
packages/nocodb/Dockerfile

@ -27,11 +27,10 @@ RUN apk add --no-cache python3 make g++
RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy application dependency manifests to the container image.
COPY ./package.json ./package.json
COPY ./docker/main.js ./docker/main.js
#COPY ./docker/start.sh /usr/src/appEntry/start.sh
COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh
COPY src/public/ ./docker/public/
COPY --link ./package.json ./package.json
COPY --link ./docker/main.js ./docker/main.js
COPY --link ./docker/start-litestream.sh /usr/src/appEntry/start.sh
COPY --link src/public/ ./docker/public/
# for pnpm to generate a flat node_modules without symlinks
# so that modclean could work as expected
@ -67,11 +66,11 @@ RUN apk add --update --no-cache \
dumb-init
# Copy litestream binary and config file
COPY --from=lt-builder /usr/src/lt /usr/local/bin/litestream
COPY ./docker/litestream.yml /etc/litestream.yml
COPY --link --from=lt-builder /usr/src/lt /usr/local/bin/litestream
COPY --link ./docker/litestream.yml /etc/litestream.yml
# Copy production code & main entry file
COPY --from=builder /usr/src/app/ /usr/src/app/
COPY --from=builder /usr/src/appEntry/ /usr/src/appEntry/
COPY --link --from=builder /usr/src/app/ /usr/src/app/
COPY --link --from=builder /usr/src/appEntry/ /usr/src/appEntry/
EXPOSE 8080
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

14
packages/nocodb/Dockerfile.local

@ -13,11 +13,11 @@ RUN apk add --no-cache python3 make g++
RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy application dependency manifests to the container image.
COPY ./package.json ./package.json
COPY ./docker/nc-gui/ ./docker/nc-gui/
COPY ./docker/main.js ./docker/index.js
COPY ./docker/start-local.sh /usr/src/appEntry/start.sh
COPY src/public/ ./docker/public/
COPY --link ./package.json ./package.json
COPY --link ./docker/nc-gui/ ./docker/nc-gui/
COPY --link ./docker/main.js ./docker/index.js
COPY --link ./docker/start-local.sh /usr/src/appEntry/start.sh
COPY --link src/public/ ./docker/public/
# for pnpm to generate a flat node_modules without symlinks
# so that modclean could work as expected
@ -50,8 +50,8 @@ RUN apk add --update --no-cache \
jq
# Copy production code & main entry file
COPY --from=builder /usr/src/app/ /usr/src/app/
COPY --from=builder /usr/src/appEntry/ /usr/src/appEntry/
COPY --link --from=builder /usr/src/app/ /usr/src/app/
COPY --link --from=builder /usr/src/appEntry/ /usr/src/appEntry/
EXPOSE 8080
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

21
packages/nocodb/litestream/Dockerfile

@ -19,10 +19,9 @@ WORKDIR /usr/src/app
RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy application dependency manifests to the container image.
COPY ./package*.json ./
COPY ./docker/main.js ./docker/main.js
#COPY ./docker/start.sh /usr/src/appEntry/start.sh
COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh
COPY --link ./package*.json ./
COPY --link ./docker/main.js ./docker/main.js
COPY --link ./docker/start-litestream.sh /usr/src/appEntry/start.sh
# for pnpm to generate a flat node_modules without symlinks
# so that modclean could work as expected
@ -75,20 +74,20 @@ ENV LITESTREAM_S3_SKIP_VERIFY=false \
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
#COPY ./build/ ./build/
#COPY ./docker/main.js ./docker/main.js
#COPY ./package.json ./
#COPY --link ./build/ ./build/
#COPY --link ./docker/main.js ./docker/main.js
#COPY --link ./package.json ./
RUN apk add --update --no-cache \
nodejs \
tar
# Copy litestream binary and config file
COPY --from=lt /usr/src/lt /usr/local/bin/litestream
COPY ./docker/litestream.yml /etc/litestream.yml
COPY --link --from=lt /usr/src/lt /usr/local/bin/litestream
COPY --link ./docker/litestream.yml /etc/litestream.yml
# Copy production code & main entry file
COPY --from=builder /usr/src/app/ /usr/src/app/
COPY --from=builder /usr/src/appEntry/ /usr/src/appEntry/
COPY --link --from=builder /usr/src/app/ /usr/src/app/
COPY --link --from=builder /usr/src/appEntry/ /usr/src/appEntry/
# Run the web service on container startup.

Loading…
Cancel
Save