Files
projects/Dockers/strapi/Dockerfile
T
Bram 752c614b98
Build and Push Docker Images / build-and-push (push) Failing after 8m58s
transition to yarn
2025-08-20 14:17:52 +02:00

43 lines
1.0 KiB
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 i -g yarn
# Copy the rest of the Strapi app to a template directory
COPY ./strapi /opt/app-template
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
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
ENTRYPOINT ["/entrypoint.sh"]
CMD ["yarn", "develop"]