{"id":19431971,"url":"https://github.com/naskio/docker-strapi","last_synced_at":"2025-04-04T18:05:21.940Z","repository":{"id":37526923,"uuid":"463093914","full_name":"naskio/docker-strapi","owner":"naskio","description":"Docker image for strapi v4 (latest version)","archived":false,"fork":false,"pushed_at":"2025-03-27T01:52:34.000Z","size":73,"stargazers_count":148,"open_issues_count":11,"forks_count":52,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T17:07:45.989Z","etag":null,"topics":["cms","compose","docker","docker-compose","docker-image","headless","image","strapi","strapi-cms","v4"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/naskio/strapi","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naskio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-24T09:56:48.000Z","updated_at":"2025-03-28T16:49:48.000Z","dependencies_parsed_at":"2023-12-01T02:33:38.279Z","dependency_job_id":"baf49a0a-34b7-4284-9343-7e01b02a9040","html_url":"https://github.com/naskio/docker-strapi","commit_stats":null,"previous_names":[],"tags_count":146,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naskio%2Fdocker-strapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naskio%2Fdocker-strapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naskio%2Fdocker-strapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naskio%2Fdocker-strapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naskio","download_url":"https://codeload.github.com/naskio/docker-strapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","compose","docker","docker-compose","docker-image","headless","image","strapi","strapi-cms","v4"],"created_at":"2024-11-10T14:33:29.581Z","updated_at":"2025-04-04T18:05:21.916Z","avatar_url":"https://github.com/naskio.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strapi (v4+) containerized\n\n![Strapi](https://github.com/naskio/docker-strapi/blob/main/assets/PNG.logo.purple.dark.png?raw=true)\n\n\u003e Docker image for strapi version 4 (latest version)\n\nAPI creation made simple, secure and fast. The most advanced open-source Content Management Framework to build powerful\nAPI with no effort.\n\n[GitHub repository](https://github.com/naskio/docker-strapi)\n\n[Docker Hub](https://hub.docker.com/r/naskio/strapi)\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/naskio/strapi.svg?style=for-the-badge)](https://hub.docker.com/r/naskio/strapi)\n\n---\n\n# Example\n\nUsing Docker Compose, create `docker-compose.yml` file with the following content:\n\n```yaml\nversion: \"3\"\nservices:\n  strapi:\n    image: naskio/strapi\n    environment:\n      NODE_ENV: development # or production\n    ports:\n      - \"1337:1337\"\n    # volumes:\n    #   - ./app:/srv/app # mount an existing strapi project\n```\n\nor using Docker:\n\n```shell\ndocker run -d -p 1337:1337 naskio/strapi --env NODE_ENV=development\n```\n\nYou can find more example on [GitHub](https://github.com/naskio/docker-strapi/tree/main/examples).\n\n---\n\n# How to use ?\n\nThis image allows you to create a new strapi project or run an existing strapi project.\n\n- for `$NODE_ENV = development`: The command that will run in your project\n  is [`strapi develop`](https://docs.strapi.io/developer-docs/latest/developer-resources/cli/CLI.html#strapi-develop).\n- for `$NODE_ENV = production`: The command that will run in your project\n  is [`strapi start`](https://docs.strapi.io/developer-docs/latest/developer-resources/cli/CLI.html#strapi-start).\n\n\u003e The [Content-Type Builder](https://strapi.io/features/content-types-builder) plugin is disabled WHEN `$NODE_ENV = production`.\n\n## Creating a new strapi project\n\nWhen running this image, strapi will check if there is a project in the `/srv/app` folder of the container. If there is\nnothing then it will run\nthe [`strapi new`](https://docs.strapi.io/developer-docs/latest/developer-resources/cli/CLI.html#strapi-new)\ncommand in the container /srv/app folder.\n\nThis command creates a project with an SQLite database. Then starts it on port `1337`.\n\n**Environment variables**\n\nWhen creating a new project with this image you can pass database configurations to\nthe [`strapi new`](https://strapi.io/documentation/developer-docs/latest/developer-resources/cli/CLI.html#strapi-new)\ncommand.\n\n- `DATABASE_CLIENT` a database provider supported by Strapi: (sqlite, postgres, mysql ,mongo).\n- `DATABASE_HOST` database host.\n- `DATABASE_PORT` database port.\n- `DATABASE_NAME` database name.\n- `DATABASE_USERNAME` database username.\n- `DATABASE_PASSWORD` database password.\n- `DATABASE_SSL` boolean for SSL.\n- `EXTRA_ARGS` pass extra args to\n  the [`strapi new`](https://strapi.io/documentation/developer-docs/latest/developer-resources/cli/CLI.html#strapi-new).\n\n## Running an existing strapi project\n\nTo run an existing project, you can mount the project folder in the container at `/srv/app`.\n\n---\n\n# Recommended way to deploy an existing strapi project to production using Docker\n\nTo deploy an existing strapi project to production using Docker, it is recommended to build an image for your project\nbased on [node v18](https://hub.docker.com/_/node).\n\nExample of Dockerfile:\n\n```dockerfile\nFROM node:18\n# alternatively you can use FROM strapi/base:latest\n\n# Set up working directory\nWORKDIR /app\n\n# Copy package.json to root directory\nCOPY package.json .\n\n# Copy yarn.lock to root directory\nCOPY yarn.lock .\n\n# Install dependencies, but not generate a yarn.lock file and fail if an update is needed\nRUN yarn install --frozen-lockfile\n\n# Copy strapi project files\nCOPY favicon.ico ./favicon.ico\nCOPY src/ src/\nCOPY public/ public/\nCOPY database/ database/\nCOPY config/ config/\n# ...\n\n# Build admin panel\nRUN yarn build\n\n# Run on port 1337\nEXPOSE 1337\n\n# Start strapi server\nCMD [\"yarn\", \"start\"]\n```\n\n# Official Documentation\n\n- The official documentation of strapi is available on [https://docs.strapi.io/](https://docs.strapi.io/).\n\n- The official strapi docker image is available on [GitHub](https://github.com/strapi/strapi-docker) (not yet upgraded\n  to v4).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaskio%2Fdocker-strapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaskio%2Fdocker-strapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaskio%2Fdocker-strapi/lists"}