Self created docker image API error (have rebuild)

System Information
  • 4.12.5 (but not limited to):
  • Host macOS - docker = node:16:
  • DB = SQLite:
  • Node V:16.6.0:

Hi, I have created my own docker image for strapi as below.

FROM node:16.16.0-alpine3.16
RUN mkdir /app
WORKDIR /app
COPY ./package.json ./yarn.lock ./
RUN yarn install --silent
COPY . .
RUN yarn build
EXPOSE 80
ENV NODE_ENV="production"
CMD ["yarn","start"]

The docker image builds fine and when it is run on the device it is created on then it has no issues.
However if I push it to docker hub and pull on a different machine then it always displays the API error when trying to access the admin area.

I have read in other posts that when the API error comes up (" Warning: An error occurred while requesting the API") strapi needs to be rebuild, but as you can see the docker image does this.

This happens when the image is build for linux/arm(7/8) or amd64

I am at a loss as to why this is happening. Both hosts machines are macOS.

Am I missing something obvious? I can’t see it anymore :slight_smile: