Sign inSign up

dunadigital/strapi

By dunadigital

•Updated about 2 years ago

AMD64 and ARM64v8 - Strapi dockerized for an easy use

Image
Content management system
6

50K+

dunadigital/strapi repository overview

⁠Docker image for Strapi v4

Learn more about Strapi: https://github.com/strapi/strapi⁠

⁠Why we built this

Our goal was to continue the same structure which was provided by Strapi's developers but somehow they are not releasing new Docker images for their project. See more details about the abandoned project here: https://github.com/strapi/strapi-docker⁠

⁠Changelog

Until this point, we updated the project many times, but now, with the version 4.25.2 we refactored the Dockerfile and managed to reduce it's size drastically. So when creating new projects, please use 4.25.2 or above version.

⁠4.25.6
  • Updated strapi to version 4.25.6
⁠4.25.5
  • Updated strapi to version 4.25.5
⁠4.25.2
  • Updated NodeJS version to 20.15
  • Refactored Dockerfile to not contain Strapi pre-installed. This way the image is way smaller.
  • Refactored the entry.sh script to not use strapi new command but yarn create strapi-app command to setup any new project
  • After launching the image, if it doesn't find a package.json folder, it'll install a new TypeScript based project into the /srv/app folder. This folder should be mounted on your device.
  • If the script sees a package.json but not able to find the node_modules folder, it'll install it (with npm but if there is a yarn.lock file to be found then with yarn)
  • Instead of PostgreSQL, now we use mariadb as default, but feel free to modify that in your docker-compose.yml file.

⁠Example docker-compose.yml file

Both ARM64v8 and AMD64 Images are available! Your system will automatically select the right version of the image.

services:
  strapi:
    container_name: strapi
    image: dunadigital/strapi:4.25.6
    environment:
      NODE_ENV: production
      DATABASE_CLIENT: mysql
      DATABASE_HOST: mariadb
      DATABASE_PORT: 3306
      DATABASE_NAME: strapi
      DATABASE_USERNAME: strapi
      DATABASE_PASSWORD: strapi
      JWT_SECRET: YOUR_SECRET
      ADMIN_JWT_SECRET: YOUR_SECRET
      APP_KEYS: YOUR_SECRET,YOUR_SECRET,YOUR_SECRET,YOUR_SECRET
    ports:
      - "1337:1337"
    volumes:
      - ./app:/srv/app
  mariadb:
    container_name: mariadb
    image: mariadb:10.6
    environment:
      MARIADB_ROOT_PASSWORD: root
      MYSQL_DATABASE: strapi
      MYSQL_USER: strapi
      MYSQL_PASSWORD: strapi
    ports:
      - "3306:3306"
    volumes:
      - ./data:/var/lib/mysql

Tag summary

Content type

Image

Digest

sha256:34531906b…

Size

379.8 MB

Last updated

about 2 years ago

docker pull dunadigital/strapi