Skip to content

Commit bf491c6

Browse files
fix: build entire Docker image
1 parent 4dbd861 commit bf491c6

File tree

3 files changed

+23
-32
lines changed

3 files changed

+23
-32
lines changed

.github/workflows/docker-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ jobs:
3030
uses: docker/build-push-action@v5
3131
with:
3232
context: .
33-
platforms: linux/amd64,linux/arm64
33+
platforms: linux/amd64
3434
push: true
3535
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ github.sha }}

Dockerfile

+22-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
ARG APP_PATH=/opt/outline
2-
FROM outlinewiki/outline-base AS base
2+
FROM node:20-slim AS base
3+
4+
ARG APP_PATH
5+
WORKDIR $APP_PATH
6+
COPY ./package.json ./yarn.lock ./
7+
COPY ./patches ./patches
8+
9+
RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \
10+
yarn cache clean
11+
12+
COPY . .
13+
ARG CDN_URL
14+
RUN yarn build
15+
16+
RUN rm -rf node_modules
17+
18+
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
19+
yarn cache clean
20+
21+
ENV PORT=3000
22+
323

424
ARG APP_PATH
525
WORKDIR $APP_PATH
@@ -20,11 +40,6 @@ COPY --from=base $APP_PATH/.sequelizerc ./.sequelizerc
2040
COPY --from=base $APP_PATH/node_modules ./node_modules
2141
COPY --from=base $APP_PATH/package.json ./package.json
2242

23-
# Install wget to healthcheck the server
24-
RUN apt-get update \
25-
&& apt-get install -y wget \
26-
&& rm -rf /var/lib/apt/lists/*
27-
2843
# Create a non-root user compatible with Debian and BusyBox based images
2944
RUN addgroup --gid 1001 nodejs && \
3045
adduser --uid 1001 --ingroup nodejs nodejs && \
@@ -38,10 +53,7 @@ RUN mkdir -p "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
3853
chmod 1777 "$FILE_STORAGE_LOCAL_ROOT_DIR"
3954

4055
VOLUME /var/lib/outline/data
41-
4256
USER nodejs
43-
44-
HEALTHCHECK --interval=1m CMD wget -qO- "http://localhost:${PORT:-3000}/_health" | grep -q "OK" || exit 1
45-
4657
EXPOSE 3000
58+
4759
CMD ["yarn", "start"]

Dockerfile.base

-21
This file was deleted.

0 commit comments

Comments
 (0)