Skip to content

Commit cd383d6

Browse files
feat: single Dockerfile, merged upstream updates
1 parent b595a0d commit cd383d6

6 files changed

+63
-207
lines changed

.github/workflows/calibreapp-image-actions.yml

-61
This file was deleted.

.github/workflows/codeql-analysis.yml

-70
This file was deleted.

.github/workflows/docker-publish.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docker Image Builder
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v3
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Log in to GitHub Container Registry
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Build and push container image
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: .
33+
platforms: linux/amd64
34+
push: true
35+
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ github.sha }}

.github/workflows/stale.yml

-29
This file was deleted.

Dockerfile

+28-26
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
11
ARG APP_PATH=/opt/outline
2-
FROM outlinewiki/outline-base AS base
2+
FROM node:20-slim AS builder
33

44
ARG APP_PATH
55
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+
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
18+
yarn cache clean
619

7-
# ---
820
FROM node:20-slim AS runner
921

10-
LABEL org.opencontainers.image.source="https://github.com/outline/outline"
22+
LABEL org.opencontainers.image.source="https://github.com/eagletrt/outline"
1123

1224
ARG APP_PATH
1325
WORKDIR $APP_PATH
1426
ENV NODE_ENV=production
27+
ENV PORT=3000
28+
ENV FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
1529

16-
COPY --from=base $APP_PATH/build ./build
17-
COPY --from=base $APP_PATH/server ./server
18-
COPY --from=base $APP_PATH/public ./public
19-
COPY --from=base $APP_PATH/.sequelizerc ./.sequelizerc
20-
COPY --from=base $APP_PATH/node_modules ./node_modules
21-
COPY --from=base $APP_PATH/package.json ./package.json
22-
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/*
30+
COPY --from=builder $APP_PATH/build ./build
31+
COPY --from=builder $APP_PATH/server ./server
32+
COPY --from=builder $APP_PATH/public ./public
33+
COPY --from=builder $APP_PATH/.sequelizerc ./.sequelizerc
34+
COPY --from=builder $APP_PATH/node_modules ./node_modules
35+
COPY --from=builder $APP_PATH/package.json ./package.json
2736

28-
# Create a non-root user compatible with Debian and BusyBox based images
37+
# Create a non-root user for better security
2938
RUN addgroup --gid 1001 nodejs && \
3039
adduser --uid 1001 --ingroup nodejs nodejs && \
31-
chown -R nodejs:nodejs $APP_PATH/build && \
32-
mkdir -p /var/lib/outline && \
33-
chown -R nodejs:nodejs /var/lib/outline
34-
35-
ENV FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
36-
RUN mkdir -p "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
37-
chown -R nodejs:nodejs "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
38-
chmod 1777 "$FILE_STORAGE_LOCAL_ROOT_DIR"
40+
mkdir -p $FILE_STORAGE_LOCAL_ROOT_DIR && \
41+
chown -R nodejs:nodejs $APP_PATH && \
42+
chown -R nodejs:nodejs $FILE_STORAGE_LOCAL_ROOT_DIR && \
43+
chmod 1777 $FILE_STORAGE_LOCAL_ROOT_DIR
3944

4045
VOLUME /var/lib/outline/data
4146

4247
USER nodejs
43-
44-
HEALTHCHECK --interval=1m CMD wget -qO- "http://localhost:${PORT:-3000}/_health" | grep -q "OK" || exit 1
45-
4648
EXPOSE 3000
4749
CMD ["yarn", "start"]

Dockerfile.base

-21
This file was deleted.

0 commit comments

Comments
 (0)