Update Dockerfile

This commit is contained in:
Alexandre
2024-03-18 16:36:53 +01:00
committed by GitHub
parent f90671aca6
commit 8701506fd5

View File

@@ -28,41 +28,12 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=0
FROM node:18.18-bullseye-slim
ARG DEBIAN_FRONTEND=noninteractive
# Install postgres
RUN \
# Recreate data
mkdir /data_linkwarden
WORKDIR /data_linkwarden
RUN \
# Get repo
apt-get update && \
apt-get install -y git && \
git clone https://github.com/linkwarden/linkwarden.git && \
\
# Adapt for sqlite
sed -i "s|postgresql|sqlite|g" linkwarden/prisma/schema.prisma && \
\
# Copy files
cp linkwarden/package.json linkwarden/yarn.lock linkwarden/playwright.config.ts .
# Increase timeout to pass github actions arm64 build
RUN --mount=type=cache,sharing=locked,target=/usr/local/share/.cache/yarn yarn install --network-timeout 10000000
RUN npx playwright install-deps && \
apt-get clean && \
yarn cache clean
RUN echo "NEXTAUTH_SECRET=homeassistant_secret" > .env && \
echo "NEXTAUTH_URL=http://localhost:3000/api/v1/auth" >> .env && \
echo "NEXTAUTH_SECRET=file:/config/database/linkwarden.sqlite" >> .env && \
cp -rnf linkwarden/* .
RUN yarn prisma generate && \
yarn build
apt update && apt install vim gnupg2 lsb-release -y && \
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc| gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg && \
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
apt update && apt install -y postgresql-16
##################
# 3 Install apps #