Strapi v4 docker

Hi,
When the docker version of strapi v4 will be available on docker hub please ?
Thank you

5 Likes

Up, I’m waiting for official image too.

You can create your own image quite simply by doing

FROM node:16-alpine
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/
COPY ./package.json ./
COPY ./yarn.lock ./
ENV PATH /opt/node_modules/.bin:$PATH
RUN yarn config set network-timeout 600000 -g
RUN yarn install
WORKDIR /opt/app
COPY ./ .
RUN yarn build
EXPOSE 1337
CMD ["yarn", "start"]
1 Like

This doesn’t work for me. Get all kind of error messages, which i didn’t get with the latest 3.x version. After changing to node:16-bullseye, it did install correctly. I can open it, but then get some “Reload Component …” is missing Error and cannot use the page.

The autoReload feature is required to use this plugin. Start your server with strapi develop

The docker build is not meant to be used for development, if you want development it’s better to run a database in a container then use your local machine for development (Been this in V3 as well)
Note that yarn start will not run development. it would be yarn develop on the last line.

exactly - I cannot even install it without docker through npx on macos - still bunch of errors

Is there an official image available soon - any infos about that?

This helped me to bootstrap my app in v4 : How to Deploy and Scale the Official Strapi Demo App "Foodadvisor" with Kubernetes & Docker

Had to pick the v4 branch (the one mentioned in the article is missing) and to fix a missing component build problem.

For the rest it’s ok.

I hope this helps.

Still i will wait for the official image to develop my new project.

+1 Less marketing and more prio for a official docker image with latest and greatest…

Wrote my own blog how you can make your own docker image :slight_smile:

1 Like