plane/Dockerfile.base

59 lines
2.0 KiB
Docker

FROM git.orionkindel.com/tpl/asdf:bookworm-full AS system
RUN apt-get update && apt-get install -y wget nginx procps lsb-release tmux
RUN wget https://dl.min.io/server/minio/release/linux-amd64/minio -O /usr/bin/minio && chmod +x /usr/bin/minio
RUN go install github.com/DarthSim/overmind/v2@latest
RUN asdf global python 3.12.3 && asdf plugin remove postgres && pip install setuptools
RUN npm i -g yarn && yarn set version 1.22.19
RUN sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update \
&& apt-get -y install postgresql
RUN set -eo pipefail; \
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg; \
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb bookworm main" | tee /etc/apt/sources.list.d/redis.list; \
apt-get update; \
apt-get install -y redis
FROM system AS next_build
RUN mkdir /app
WORKDIR /app
COPY package.json turbo.json yarn.lock app.json .
COPY packages packages
COPY web web
COPY space space
RUN --mount=type=cache,target=/root/.cache/yarn \
yarn install --frozen-lockfile \
&& yarn build \
&& rm -rf node_modules
RUN mkdir -p web/.next/standalone/web/.next \
&& mv web/public web/.next/standalone/web/public \
&& mv web/.next/static web/.next/standalone/web/.next/static \
&& mkdir -p space/.next/standalone/_next \
&& mv space/public space/.next/standalone/space/public \
&& mv space/.next/static space/.next/standalone/space/.next/static
FROM next_build AS api_build
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
COPY apiserver apiserver
RUN --mount=type=cache,target=/root/.cache/pip \
cd apiserver \
&& pip install -r requirements.txt --compile \
&& pip install -r requirements/local.txt --compile
FROM api_build AS run
COPY docker/etc/ /etc/
ENTRYPOINT ["bash", "-l"]