Files
projects/Dockers/strapi/Dockerfile
T
Bram fa534b65f2
Build and Push Docker Images / build-and-push (push) Successful in 21s
allowed hosts
2025-05-08 16:43:11 +02:00

38 lines
912 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
# Optionally set a default value for ALLOWED_HOSTS
ENV ALLOWED_HOSTS=localhost
# No need to build in development mode
EXPOSE 1337
CMD ["npm", "run", "develop"]