diff --git a/Dockerfile b/Dockerfile index 55356f7718..6788add881 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,11 @@ 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 +# Install wget to healthcheck the server +RUN apt-get update \ + && apt-get install -y wget \ + && rm -rf /var/lib/apt/lists/* + # Create a non-root user compatible with Debian and BusyBox based images RUN addgroup --gid 1001 nodejs && \ adduser --uid 1001 --ingroup nodejs nodejs && \ @@ -36,5 +41,7 @@ VOLUME /var/lib/outline/data USER nodejs +HEALTHCHECK CMD wget -qO- http://localhost:${PORT}/_health | grep -q "OK" || exit 1 + EXPOSE 3000 CMD ["yarn", "start"] diff --git a/Dockerfile.base b/Dockerfile.base index 49defc36b4..13378f1caa 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -6,10 +6,6 @@ WORKDIR $APP_PATH COPY ./package.json ./yarn.lock ./ COPY ./patches ./patches -RUN apt-get update \ - && apt-get install -y wget \ - && rm -rf /var/lib/apt/lists/* - RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \ yarn cache clean @@ -23,4 +19,3 @@ RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 & yarn cache clean ENV PORT=3000 -HEALTHCHECK CMD wget -qO- http://localhost:${PORT}/_health | grep -q "OK" || exit 1