dockerfile tweaks
This commit is contained in:
parent
f4c507d429
commit
c7e167786c
|
@ -6,4 +6,4 @@ build/
|
||||||
node_modules/
|
node_modules/
|
||||||
# Ignoring folders that might be used in starter templates
|
# Ignoring folders that might be used in starter templates
|
||||||
data/
|
data/
|
||||||
backup/
|
backup
|
|
@ -1,16 +1,14 @@
|
||||||
FROM node:18.16-alpine as base
|
FROM node:18.16-alpine
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
ENV NODE_ENV=production
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
# Installing libvips-dev for sharp Compatibility
|
# Installing libvips-dev for sharp Compatibility
|
||||||
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev libc6-compat git nasm bash gcompat
|
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev libc6-compat git nasm bash gcompat
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
||||||
COPY pnpm-lock.yaml package.json ./
|
COPY pnpm-lock.yaml package.json ./
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||||
COPY ./packages/strapi .
|
COPY ./packages/strapi .
|
||||||
ENV PATH=/app/node_modules/.bin:$PATH
|
|
||||||
RUN chown -R node:node /app
|
RUN chown -R node:node /app
|
||||||
USER node
|
USER node
|
||||||
|
|
||||||
|
@ -19,6 +17,6 @@ USER node
|
||||||
# ENV NODE_ENV=development
|
# ENV NODE_ENV=development
|
||||||
# CMD ["pnpm", "run", "dev"]
|
# CMD ["pnpm", "run", "dev"]
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
ENTRYPOINT ["pnpm"]
|
ENTRYPOINT ["pnpm"]
|
||||||
CMD ["run", "start"]
|
CMD ["run", "start"]
|
Loading…
Reference in New Issue