Files
projects/Dockers/strapi/Dockerfile
T
Bram c3ef6a98da
Build and Push Docker Images / build-and-push (push) Failing after 11s
strapi
2025-05-08 16:31:21 +02:00

35 lines
832 B
Docker

FROM node:22-alpine
# Install dependencies for sharp and other native modules
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev git
# Set development environment
ENV NODE_ENV=development
WORKDIR /opt/app
# Copy only package.json and package-lock.json first for better caching
COPY ./strapi/package.json ./strapi/package-lock.json ./
# Install all dependencies (including devDependencies)
RUN npm ci
# Copy the rest of the Strapi app
COPY ./strapi ./
ENV DATABASE_CLIENT=postgres
ENV DATABASE_NAME=strapi
ENV DATABASE_HOST=postgres
ENV DATABASE_PORT=5432
ENV DATABASE_USERNAME=strapi
ENV DATABASE_PASSWORD=strapi
ENV JWT_SECRET=secret
ENV ADMIN_JWT_SECRET=secret
ENV APP_KEYS=secret
# No need to build in development mode
EXPOSE 1337
CMD ["npm", "run", "develop"]