mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.0 KiB
73 lines
2.0 KiB
3 years ago
|
###########
|
||
|
# Litestream Builder
|
||
|
###########
|
||
|
FROM golang:alpine3.14 as lt-builder
|
||
|
|
||
|
WORKDIR /usr/src/
|
||
|
|
||
|
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 cp $GOPATH/bin/litestream /usr/src/lt
|
||
|
|
||
|
|
||
|
|
||
4 years ago
|
###########
|
||
|
# Builder
|
||
|
###########
|
||
2 years ago
|
FROM node:16.17.0-alpine3.15 as builder
|
||
4 years ago
|
WORKDIR /usr/src/app
|
||
4 years ago
|
|
||
2 years ago
|
# install node-gyp dependencies
|
||
|
RUN apk add --no-cache python3 make g++
|
||
|
|
||
4 years ago
|
# Copy application dependency manifests to the container image.
|
||
|
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
|
||
4 years ago
|
# Copying this separately prevents re-running npm ci on every code change.
|
||
|
COPY ./package*.json ./
|
||
4 years ago
|
COPY ./docker/main.js ./docker/main.js
|
||
2 years ago
|
#COPY ./docker/start.sh /usr/src/appEntry/start.sh
|
||
3 years ago
|
COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh
|
||
2 years ago
|
COPY ./src/lib/public/css/*.css ./docker/public/css/
|
||
|
COPY ./src/lib/public/js/*.js ./docker/public/js/
|
||
|
COPY ./src/lib/public/favicon.ico ./docker/public/
|
||
4 years ago
|
|
||
4 years ago
|
# install production dependencies,
|
||
|
# reduce node_module size with modclean & removing sqlite deps,
|
||
|
# package built code into app.tar.gz & add execute permission to start.sh
|
||
2 years ago
|
RUN npm ci --omit=dev --quiet \
|
||
2 years ago
|
&& npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run \
|
||
4 years ago
|
&& rm -rf ./node_modules/sqlite3/deps \
|
||
4 years ago
|
&& tar -czf ../appEntry/app.tar.gz ./* \
|
||
|
&& chmod +x /usr/src/appEntry/start.sh
|
||
4 years ago
|
|
||
4 years ago
|
##########
|
||
|
# Runner
|
||
|
##########
|
||
2 years ago
|
FROM alpine:3.15
|
||
4 years ago
|
WORKDIR /usr/src/app
|
||
|
|
||
3 years ago
|
ENV NC_DOCKER 0.6
|
||
2 years ago
|
ENV NODE_ENV production
|
||
3 years ago
|
ENV PORT 8080
|
||
|
ENV NC_TOOL_DIR=/usr/app/data/
|
||
|
|
||
4 years ago
|
RUN apk --update --no-cache add \
|
||
|
nodejs \
|
||
3 years ago
|
tar \
|
||
|
dumb-init
|
||
4 years ago
|
|
||
3 years ago
|
# Copy litestream binary build
|
||
|
COPY --from=lt-builder /usr/src/lt /usr/src/appEntry/litestream
|
||
4 years ago
|
# Copy packaged production code & main entry file
|
||
|
COPY --from=builder /usr/src/appEntry/ /usr/src/appEntry/
|
||
4 years ago
|
|
||
4 years ago
|
EXPOSE 8080
|
||
3 years ago
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||
4 years ago
|
|
||
4 years ago
|
# Start Nocodb
|
||
3 years ago
|
CMD ["/usr/src/appEntry/start.sh"]
|