From 75bfcbbfbcce6e9656af9e4e170be4b6da9de2bc Mon Sep 17 00:00:00 2001 From: Salim B Date: Wed, 15 May 2024 23:58:44 +0200 Subject: [PATCH] chore: make Dockerfiles more idiomatic --- packages/nocodb/Dockerfile | 11 +++++------ packages/nocodb/Dockerfile.local | 12 +++++++----- packages/nocodb/litestream/Dockerfile | 12 ++++++------ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/nocodb/Dockerfile b/packages/nocodb/Dockerfile index 0b7e56eceb..7ba7952633 100644 --- a/packages/nocodb/Dockerfile +++ b/packages/nocodb/Dockerfile @@ -1,7 +1,9 @@ +# syntax=docker/dockerfile:1 + ########### # Litestream Builder ########### -FROM golang:alpine3.18 as lt-builder +FROM golang:alpine3.19 as lt-builder WORKDIR /usr/src/ @@ -9,12 +11,9 @@ RUN apk add --no-cache git make musl-dev gcc # build litestream RUN git clone https://github.com/benbjohnson/litestream.git litestream -RUN cd litestream ; go install ./cmd/litestream - +RUN cd litestream && go install ./cmd/litestream RUN cp $GOPATH/bin/litestream /usr/src/lt - - ########### # Builder ########### @@ -63,7 +62,7 @@ ENV LITESTREAM_S3_SKIP_VERIFY=false \ NODE_ENV=production \ PORT=8080 -RUN apk --update --no-cache add \ +RUN apk add --update --no-cache \ nodejs \ dumb-init diff --git a/packages/nocodb/Dockerfile.local b/packages/nocodb/Dockerfile.local index 72504ddfe5..04e470a80c 100644 --- a/packages/nocodb/Dockerfile.local +++ b/packages/nocodb/Dockerfile.local @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + ########### # Builder ########### @@ -36,12 +38,12 @@ RUN pnpm install --prod --shamefully-hoist --reporter=silent \ FROM alpine:3.19 WORKDIR /usr/src/app -ENV NC_DOCKER 0.6 -ENV NODE_ENV production -ENV PORT 8080 -ENV NC_TOOL_DIR=/usr/app/data/ +ENV NC_DOCKER=0.6 \ + NC_TOOL_DIR=/usr/app/data/ \ + NODE_ENV=production \ + PORT=8080 -RUN apk --update --no-cache add \ +RUN apk add --update --no-cache \ nodejs \ dumb-init \ curl \ diff --git a/packages/nocodb/litestream/Dockerfile b/packages/nocodb/litestream/Dockerfile index ec45e80e7f..310315729b 100644 --- a/packages/nocodb/litestream/Dockerfile +++ b/packages/nocodb/litestream/Dockerfile @@ -1,4 +1,6 @@ -FROM golang:alpine3.18 as lt +# syntax=docker/dockerfile:1 + +FROM golang:alpine3.19 as lt WORKDIR /usr/src/ @@ -6,12 +8,10 @@ RUN apk add --no-cache git make musl-dev gcc # build litestream RUN git clone https://github.com/benbjohnson/litestream.git litestream -RUN cd litestream ; go install ./cmd/litestream - +RUN cd litestream && go install ./cmd/litestream RUN cp $GOPATH/bin/litestream /usr/src/lt - FROM node:18.19.1-alpine as builder WORKDIR /usr/src/app @@ -36,6 +36,7 @@ RUN pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,ex RUN rm -rf ./node_modules/sqlite3/deps RUN chmod +x /usr/src/appEntry/start.sh + FROM alpine:3.19 #WORKDIR /usr/src/ @@ -55,7 +56,6 @@ FROM alpine:3.19 #RUN git clone https://github.com/benbjohnson/litestream.git litestream #RUN cd litestream ; go install ./cmd/litestream - # Bug fix for segfault ( Convert PT_GNU_STACK program header into PT_PAX_FLAGS ) #RUN apk --update --no-cache add paxctl \ # && paxctl -cm $(which node) @@ -79,7 +79,7 @@ ENV LITESTREAM_S3_SKIP_VERIFY=false \ #COPY ./docker/main.js ./docker/main.js #COPY ./package.json ./ -RUN apk --update --no-cache add \ +RUN apk add --update --no-cache \ nodejs \ tar