Dockerized strapi production vs development

I’m in the process of writing a dokku guide but it’s not ready yet.

But in simple terms you need to run strapi start to make the server itself run. So like any nodeJS application running.

If you are running docker itself :slight_smile: then something like this should run it

FROM node:14-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"]

You will have to pass it develop as an argument else it will default to production.
With Dokku I have set it up to serve the docker image itself, so no more config is needed, except port mapping.

1 Like