coolify/Dockerfile

51 lines
1.8 KiB
Docker
Raw Normal View History

2022-09-06 11:38:36 +02:00
ARG PNPM_VERSION=7.11.0
ARG NPM_VERSION=8.19.1
2022-10-11 10:54:13 +02:00
# https://download.docker.com/linux/static/stable/
ARG DOCKER_VERSION=20.10.18
# https://github.com/docker/compose/releases
# Reverted to 2.6.1 because of this https://github.com/docker/compose/issues/9704. 2.9.0 still has a bug.
ARG DOCKER_COMPOSE_VERSION=2.6.1
# https://github.com/buildpacks/pack/releases
ARG PACK_VERSION=v0.27.0
2022-09-06 11:38:36 +02:00
2022-09-02 20:44:29 +02:00
FROM node:18-slim as build
2022-02-10 15:47:44 +01:00
WORKDIR /app
2022-04-11 22:31:27 +02:00
2022-09-02 20:44:29 +02:00
RUN apt update && apt -y install curl
2022-09-06 10:14:34 +02:00
RUN npm --no-update-notifier --no-fund --global install pnpm@${PNPM_VERSION}
2022-04-11 22:31:27 +02:00
2022-07-06 11:02:36 +02:00
COPY . .
2022-04-11 22:31:27 +02:00
RUN pnpm install
2022-07-06 11:02:36 +02:00
RUN pnpm build
2022-02-10 15:47:44 +01:00
2022-07-06 11:02:36 +02:00
# Production build
2022-09-02 20:44:29 +02:00
FROM node:18-slim
2022-04-01 14:25:55 +02:00
WORKDIR /app
2022-07-06 11:02:36 +02:00
ENV NODE_ENV production
2022-09-06 14:20:14 +02:00
ARG TARGETPLATFORM
2022-04-01 14:25:55 +02:00
2022-09-06 10:14:34 +02:00
RUN apt update && apt -y install --no-install-recommends ca-certificates git git-lfs openssh-client curl jq cmake sqlite3 openssl psmisc python3
RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/
RUN npm --no-update-notifier --no-fund --global install pnpm@${PNPM_VERSION}
RUN npm install -g npm@${PNPM_VERSION}
2022-07-06 11:02:36 +02:00
2022-02-10 15:47:44 +01:00
RUN mkdir -p ~/.docker/cli-plugins/
2022-10-11 10:54:13 +02:00
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-$DOCKER_VERSION -o /usr/bin/docker
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-$DOCKER_COMPOSE_VERSION -o ~/.docker/cli-plugins/docker-compose
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/pack-$PACK_VERSION -o /usr/local/bin/pack
RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack
2022-08-11 15:04:34 +02:00
2022-07-06 11:02:36 +02:00
COPY --from=build /app/apps/api/build/ .
2022-09-15 09:34:39 +02:00
COPY --from=build /app/others/fluentbit/ ./fluentbit
2022-07-06 11:02:36 +02:00
COPY --from=build /app/apps/ui/build/ ./public
COPY --from=build /app/apps/api/prisma/ ./prisma
COPY --from=build /app/apps/api/package.json .
COPY --from=build /app/docker-compose.yaml .
2022-04-11 22:31:27 +02:00
2022-07-06 11:02:36 +02:00
RUN pnpm install -p
2022-04-11 22:31:27 +02:00
2022-02-10 15:47:44 +01:00
EXPOSE 3000
2022-08-29 15:42:18 +02:00
ENV CHECKPOINT_DISABLE=1
2022-07-06 11:02:36 +02:00
CMD pnpm start