diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3427851..2892348 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,8 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 + with: + submodules: recursive - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 @@ -47,7 +49,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64 + platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/arm/v6 push: true cache-from: type=gha cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 1be29e7..4bb1f30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,32 @@ ARG APP_PATH=/opt/outline -FROM outlinewiki/outline-base:latest as base +FROM node:20-alpine as base ARG APP_PATH WORKDIR $APP_PATH -RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \ + +FROM base AS build +COPY ./src/package.json ./src/yarn.lock ./ +COPY ./src/patches ./ +RUN cd src && \ + yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \ yarn cache clean -COPY shared /opt/outline/shared -RUN yarn build -RUN rm -rf node_modules -RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \ +COPY shared ./src/shared +RUN cd src && \ + yarn build +RUN rm -rf src/node_modules +RUN cd src && \ + yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \ yarn cache clean -FROM node:20-alpine AS release -ARG APP_PATH -WORKDIR $APP_PATH +FROM base AS release RUN apk add --no-cache curl ca-certificates ENV NODE_ENV production -COPY --from=base $APP_PATH/build ./build -COPY --from=base $APP_PATH/server ./server -COPY --from=base $APP_PATH/public ./public -COPY --from=base $APP_PATH/.sequelizerc ./.sequelizerc -COPY --from=base $APP_PATH/node_modules ./node_modules -COPY --from=base $APP_PATH/package.json ./package.json +COPY --from=build $APP_PATH/build ./build +COPY --from=build $APP_PATH/server ./server +COPY --from=build $APP_PATH/public ./public +COPY --from=build $APP_PATH/.sequelizerc ./.sequelizerc +COPY --from=build $APP_PATH/node_modules ./node_modules +COPY --from=build $APP_PATH/package.json ./package.json RUN addgroup -g 1001 -S nodejs && \ adduser -S nodejs -u 1001 && \ chown -R nodejs:nodejs $APP_PATH/build && \