Docker support for v4
complete
Derrick Mehaffy
complete
We have released our docker documentation and now consider this as complete: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/installation/docker.html
We will sunset our v3 docker image later this year once v3 reaches EOL.
CorvusGei
Derrick Mehaffy: Great to hear that you finally cared about docker users with Strapi v4! Will you update the Docker image to v4, too? I'm still using the v3 one in a testing environment from Dockerhub.
For me the new documentation didn't work for my purpose (AKS with Helm and persistent volume). I had problems with permissions, I couldn't copy the package*.json.
I solved it by creating a new group:user (removed the node one) strapi:strapi which owns the working directory.
Derrick Mehaffy
CorvusGei: At this time and for the foreseeable future we do not plan to build our own docker container as it doesn't really fit how Strapi is expected to be used in production environments. You can find an FAQ about this here: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/installation/docker.html#why-doesn-t-strapi-provide-official-docker-images
CorvusGei
Derrick Mehaffy: Thank you for your explanation.
BTW: we will use Strapi for us and a costumer on K8s-Clusters, but allow backend-access from internal networks only. And after developing our app we will switch to the production environment.
Bruno Sastre
Derrick Mehaffy: Hope you are doing well. I thought the purpose of this post, was to create a docker image for V4. Can you help me understand what was achieved?
Derrick Mehaffy
Bruno Sastre: We did evaluate creating a docker image but doing so really doesn't follow docker best practices. Strapi's "source of truth" for the content-type schema's is on the file-system, thus it really doesn't make sense for us to build a docker container that would have a mapped volume since the actual code is simply being pulled from your local file-system (meaning we aren't really shipping anything in our image other than a few dependencies). And you would almost certainly never use our image for production. We want to ensure we are teaching the community users the proper approaches on using docker both for development and production.
What was done was us properly documenting how users should be using docker (and compose) for development/staging and production environments. Likewise we wanted to highlight the tools our community has built to ease the use with docker. Supporting docker does not always mean that we need to actually create an image and in general unless you are a company shipping compiled binaries or applications who's "source of truth" is somewhere stateless such as the database then it makes sense. Strapi however is not file-system stateless in this sense and thus it does not make sense for us to build a single container that works for everyone, Strapi is far too customizable for that.
Bruno Sastre
Derrick Mehaffy: Thanks so much for the detailed answer.
Derrick Mehaffy
Bruno Sastre: quite welcome!
Alessandro Moscatelli
Derrick Mehaffy: We strongly believe this :
"FROM node:16-alpine
RUN apk update && apk add build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev"
could have became a good "strapi-base" docker image.
But hey, let's just update the documentation for this +420 upvoted feature.
Derrick Mehaffy
Alessandro Moscatelli: That container would contain nothing specific to Strapi however. If anything someone in the community could simply create a base container for something like "common build tools" or lib-vips which would make more sense. Our goal was to educate the proper real world usage of docker and not simply take the easy way out. We tend to follow the DRY method (do not repeat yourself) and we did not want to give people the wrong impression (and need to answer thousands of questions) about why our base-container has no Strapi code in it (which wouldn't make much sense).
Graham
Derrick Mehaffy: So the completed support for Docker is "We're not going to support it". Got it.
Derrick Mehaffy
Graham: As mentioned several times before, we do support it. Supporting docker does not mean we need to build and release our own images especially when there is nothing to gain by doing so. If you have an alternative to suggest please do feel free to open a new feature request for it. Likewise as a community member if you wanted to build and offer your own docker images in place of us, indeed you can do that as well.
Ty Nguyen
yes. A Docker image is gonna save tons of time for the whole community
16BitOwl
Yes please, a Docker image would be great!
Sam Pld
V3 image doesn't work any more. Considering the community uptick Docker support V4 must be made available to avoid damage to the community uptick usage of Strapi
Derrick Mehaffy
in progress
WIP documentation PR: https://github.com/strapi/documentation/pull/1144
Derrick Mehaffy
Derrick Mehaffy
Aurélien Georget
planned
u
undefined undefined
Aurélien Georget: Wonderful news!
Bruno Sastre
Aurélien Georget: Hello. Hope you are doing well. Do you have a rough ETA for this support?
Aurélien Georget
Bruno Sastre: I'm good, how are you? Let me ping the team in charge of it, I know they would like to work on it by the end of the September, however, it's also a synchronized initiative with the Community Org, so I'm not so sure about the ETA yet.
M
Marco Autiero ✅
Bruno Sastre: It's a matter of weeks :) At maximum, by the end of October
Bruno Sastre
Aurélien Georget: I am doing fine. Thanks for asking.
I appreciate your answer, thank you.
Bruno Sastre
Marco Autiero ✅: That is wonderfull news. Thanks for your answer.
l
luo li
我有洁癖,我需要docker.
G
Graham
I was trying to use v4 and found the dockerize instructions as well as some info below, but the one thing that is a major problem is that the documentation is not there, nor is it consistent. I followed the "official" (ish) guide and it worked, but later found out that no volumes were created, and even though docker-compose defined postgres, strapi was using sqlite. I found some other unofficial docker images, and overall the process has been as opaque as mud.
Load More
→