Updating Dockerfile for multistage build based on feedbacks

This commit is contained in:
Julien Recurt
2024-05-21 11:27:02 +02:00
parent a431fab3c4
commit d161411416
2 changed files with 15 additions and 8 deletions
+5
View File
@@ -11,8 +11,13 @@
# Ignore git and cache folders # Ignore git and cache folders
.git .git
.gitignore
.cache .cache
# Ignore build folders
node_modules
dist
# Ignore default volumes created by running docker compose up # Ignore default volumes created by running docker compose up
ontime-db ontime-db
ontime-styles ontime-styles
+10 -8
View File
@@ -1,11 +1,13 @@
FROM node:18.18-alpine as builder FROM node:18.18-alpine AS base
ENV NODE_ENV=docker ENV PNPM_HOME="/pnpm"
ENV ONTIME_DATA=/external/ ENV PATH="$PNPM_HOME:$PATH"
WORKDIR /app/ RUN corepack enable
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
COPY . /app/ FROM base AS builder
RUN PNPM_HOME="/root/.local/share/pnpm" PATH="${PATH}:/root/.local/share/pnpm" pnpm i COPY . /app
run PNPM_HOME="/root/.local/share/pnpm" PATH="${PATH}:/root/.local/share/pnpm" pnpm run build:localdocker WORKDIR /app
RUN pnpm install --frozen-lockfile \
&& pnpm turbo build:docker
FROM node:18.18-alpine FROM node:18.18-alpine