"Fossies" - the Fresh Open Source Software Archive

Member "nocodb-0.100.2/packages/nocodb/Dockerfile" (2 Dec 2022, 1912 Bytes) of package /linux/misc/nocodb-0.100.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Dockerfile": 0.98.4_vs_0.99.0.

    1 ###########
    2 # Litestream Builder
    3 ###########
    4 FROM golang:alpine3.14 as lt-builder
    5 
    6 WORKDIR /usr/src/
    7 
    8 RUN apk add --no-cache git make musl-dev gcc
    9 
   10 # build litestream
   11 RUN git clone https://github.com/benbjohnson/litestream.git litestream
   12 RUN cd litestream ; go install ./cmd/litestream
   13 
   14 RUN cp $GOPATH/bin/litestream /usr/src/lt
   15 
   16 
   17 
   18 ###########
   19 # Builder
   20 ###########
   21 FROM node:16.17.0-alpine3.15 as builder
   22 WORKDIR /usr/src/app
   23 
   24 # install node-gyp dependencies
   25 RUN apk add --no-cache python3 make g++
   26 
   27 # Copy application dependency manifests to the container image.
   28 # A wildcard is used to ensure both package.json AND package-lock.json are copied.
   29 # Copying this separately prevents re-running npm ci on every code change.
   30 COPY ./package*.json ./
   31 COPY ./docker/main.js ./docker/main.js
   32 #COPY ./docker/start.sh /usr/src/appEntry/start.sh
   33 COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh
   34 
   35 # install production dependencies,
   36 # reduce node_module size with modclean & removing sqlite deps,
   37 # package built code into app.tar.gz & add execute permission to start.sh
   38 RUN npm ci --omit=dev --quiet \
   39     && npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run  \
   40     && rm -rf ./node_modules/sqlite3/deps \
   41     && tar -czf ../appEntry/app.tar.gz ./* \
   42     && chmod +x /usr/src/appEntry/start.sh
   43 
   44 ##########
   45 # Runner
   46 ##########
   47 FROM alpine:3.15
   48 WORKDIR /usr/src/app
   49 
   50 ENV NC_DOCKER 0.6
   51 ENV NODE_ENV production
   52 ENV PORT 8080
   53 ENV NC_TOOL_DIR=/usr/app/data/
   54 
   55 RUN apk --update --no-cache add \
   56     nodejs \
   57     tar \
   58     dumb-init
   59 
   60 # Copy litestream binary build
   61 COPY  --from=lt-builder /usr/src/lt /usr/src/appEntry/litestream
   62 # Copy packaged production code & main entry file
   63 COPY --from=builder /usr/src/appEntry/ /usr/src/appEntry/
   64 
   65 EXPOSE 8080
   66 ENTRYPOINT ["/usr/bin/dumb-init", "--"]
   67 
   68 # Start Nocodb
   69 CMD ["/usr/src/appEntry/start.sh"]