Browse Source

chore: make Dockerfiles more idiomatic

pull/8494/head
Salim B 2 months ago
parent
commit
75bfcbbfbc
No known key found for this signature in database
GPG Key ID: C7657487017FE6D5
  1. 11
      packages/nocodb/Dockerfile
  2. 12
      packages/nocodb/Dockerfile.local
  3. 12
      packages/nocodb/litestream/Dockerfile

11
packages/nocodb/Dockerfile

@ -1,7 +1,9 @@
# syntax=docker/dockerfile:1
########### ###########
# Litestream Builder # Litestream Builder
########### ###########
FROM golang:alpine3.18 as lt-builder FROM golang:alpine3.19 as lt-builder
WORKDIR /usr/src/ WORKDIR /usr/src/
@ -9,12 +11,9 @@ RUN apk add --no-cache git make musl-dev gcc
# build litestream # build litestream
RUN git clone https://github.com/benbjohnson/litestream.git 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 RUN cp $GOPATH/bin/litestream /usr/src/lt
########### ###########
# Builder # Builder
########### ###########
@ -63,7 +62,7 @@ ENV LITESTREAM_S3_SKIP_VERIFY=false \
NODE_ENV=production \ NODE_ENV=production \
PORT=8080 PORT=8080
RUN apk --update --no-cache add \ RUN apk add --update --no-cache \
nodejs \ nodejs \
dumb-init dumb-init

12
packages/nocodb/Dockerfile.local

@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1
########### ###########
# Builder # Builder
########### ###########
@ -36,12 +38,12 @@ RUN pnpm install --prod --shamefully-hoist --reporter=silent \
FROM alpine:3.19 FROM alpine:3.19
WORKDIR /usr/src/app WORKDIR /usr/src/app
ENV NC_DOCKER 0.6 ENV NC_DOCKER=0.6 \
ENV NODE_ENV production NC_TOOL_DIR=/usr/app/data/ \
ENV PORT 8080 NODE_ENV=production \
ENV NC_TOOL_DIR=/usr/app/data/ PORT=8080
RUN apk --update --no-cache add \ RUN apk add --update --no-cache \
nodejs \ nodejs \
dumb-init \ dumb-init \
curl \ curl \

12
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/ WORKDIR /usr/src/
@ -6,12 +8,10 @@ RUN apk add --no-cache git make musl-dev gcc
# build litestream # build litestream
RUN git clone https://github.com/benbjohnson/litestream.git 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 RUN cp $GOPATH/bin/litestream /usr/src/lt
FROM node:18.19.1-alpine as builder FROM node:18.19.1-alpine as builder
WORKDIR /usr/src/app 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 rm -rf ./node_modules/sqlite3/deps
RUN chmod +x /usr/src/appEntry/start.sh RUN chmod +x /usr/src/appEntry/start.sh
FROM alpine:3.19 FROM alpine:3.19
#WORKDIR /usr/src/ #WORKDIR /usr/src/
@ -55,7 +56,6 @@ FROM alpine:3.19
#RUN git clone https://github.com/benbjohnson/litestream.git 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
# Bug fix for segfault ( Convert PT_GNU_STACK program header into PT_PAX_FLAGS ) # Bug fix for segfault ( Convert PT_GNU_STACK program header into PT_PAX_FLAGS )
#RUN apk --update --no-cache add paxctl \ #RUN apk --update --no-cache add paxctl \
# && paxctl -cm $(which node) # && paxctl -cm $(which node)
@ -79,7 +79,7 @@ ENV LITESTREAM_S3_SKIP_VERIFY=false \
#COPY ./docker/main.js ./docker/main.js #COPY ./docker/main.js ./docker/main.js
#COPY ./package.json ./ #COPY ./package.json ./
RUN apk --update --no-cache add \ RUN apk add --update --no-cache \
nodejs \ nodejs \
tar tar

Loading…
Cancel
Save