monzo / progression-framework

The Monzo Progression Framework site, built with Gatsby.
https://progression.monzo.com
MIT License
301 stars 150 forks source link

Build with Docker #68

Open danmcnulty opened 5 years ago

danmcnulty commented 5 years ago

Hi, We're trying to set this up within our CI system by creating an image which contains just the build tool, so a subsequent CI step can run the image using a volume containing our code.

Whenever we run yarn we receive a number of warnings such as these:

[1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.2.4: The platform "linux" is incompatible with this module. info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > css-loader@2.1.0" has unmet peer dependency "webpack@^4.0.0". warning " > eslint-loader@2.1.1" has unmet peer dependency "webpack@>=2.0.0 <5.0.0". warning " > @babel/preset-flow@7.0.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "gatsby-plugin-flow > @babel/preset-flow > @babel/plugin-transform-flow-strip-types@7.2.3" has unmet peer dependency "@babel/core@^7.0.0-0". warning "gatsby-plugin-flow > @babel/preset-flow > @babel/plugin-transform-flow-strip-types > @babel/plugin-syntax-flow@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning " > react-ga@2.5.7" has unmet peer dependency "prop-types@^15.6.0". warning " > react-masonry-css@1.0.12" has unmet peer dependency "prop-types@^15.0.0". warning " > gatsby-plugin-eslint@2.0.1" has incorrect peer dependency "eslint@^4.9.0". [4/4] Building fresh packages... error /app/node_modules/sharp: Command failed. Exit code: 1

Do you use Docker for development at all, and if so do you have a working Dockerfile which you could share? Thanks

szopkap commented 4 years ago

I only use docker for build and run the prod version. Here is mine dockerfile:

FROM node:10.15.3 as source
WORKDIR /src/progression-framework
COPY package.json ./
RUN npm install
COPY . ./
RUN rm -rf node_modules/sharp
RUN npm install --arch=x64 --platform=linux --target=10.15.3 sharp
RUN npm run build

The error caused by the sharp module. This version only runs at Windows OS. Need to change a linux specific one.

Some other dependencies need to update to a fresher version, that's why the many warnings, but the application still runs with these.