Closed selected-pixel-jameson closed 2 years ago
Thanks for your question. one you are using is the strapi/base which is built for strapi 3. The plugin is using Strapi 4 btw as there is a difference in folder structure. Though the dockerfile should work
Does this fail during the pipeline build, does it build locally ? If it fails in the pipeline make sure your using the nodejs platform that is supported https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-nodejs.html
Thank you for the reply.
We are not using a NodeJS Image and the pipeline is not executing a build step. The build fails when it’s being deployed on Elasticbeanstalk. Elasticbeanstalk will recognize the Dockerfile and run it during deployment so it’s failing when the Dockerfile is run. Unfortunately I can’t even get the logs to generate so I’m unable to share those.
The strapi/base image worked for this up until the NodeJS version required changed to 14.9+.
Jameson W Parker
On Aug 17, 2022, at 3:53 AM, Simen Daehlin @.***> wrote:
Thanks for your question. one you are using is the strapi/base which is built for strapi 3. The plugin is using Strapi 4 btw as there is a difference in folder structure. Though the dockerfile should work
Does this fail during the pipeline build, does it build locally ? If it fails in the pipeline make sure your using the nodejs platform that is supported https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-nodejs.html
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
Eventually I got this to work.
This is what I ended up with in my Dockerfile.
FROM node:16-alpine
WORKDIR [root_directory_name]
RUN apk update && apk add build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
COPY ./package.json ./
COPY ./yarn.lock ./
RUN yarn install
COPY . .
ENV NODE_ENV production
ENV ENV_PATH .env
RUN yarn build
EXPOSE 1337
CMD ["yarn", "start"]
Oh i see what you changed. Glad you got this worked, I will close this ticket.
But it seems that it was the workdir then.
This isn't working for me when deploying using ElasticBeanstalk and CodePipeline on AWS.
This is what I have for my Dockerfile, which was generated via this library.
The build fails and I can't even get the logs printed out. I'm using the latest Docker Image (Docker running on 64bit Amazon Linux 2/3.4.18) and deploying through CodePipeline. I'm not doing any builds on the server. If ElasticBeanstalk sees a Dockerfile it will build without any issues.
My previous Dockerfile worked fine until they updated the dependencies in Strapi to require NodeJS 14.19+.
Any help would be very much appreciated.