Rewrote Dockerfile to support the new Gatsby + Yarn toolchain with the latest stable node-alpine image
Refactored docker-compose.yml file to support changes to the Dockerfile
Created Gatsby develop service for local containerized development
Added new gatsby service for interacting with the Gatsby CLI
Confirmed gatsby cleanly builds and runs without issue in a container via docker-compose build develop && docker-compose up develop:
[+] Building 1.1s (13/13) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.87kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 35B 0.0s
=> [internal] load metadata for docker.io/library/node:16-alpine3.15 0.6s
[...]
=> exporting to image 0.2s
=> => exporting layers 0.2s
=> => writing image sha256:9edaafb57bc2d38335c7a6881fd045b1993513a1cb5d65fcb5772fba3bb2cbaa 0.0s
=> => naming to docker.io/library/auxeng-docs_develop 0.0s
[...]
[+] Running 2/0
⠿ Network auxeng-docs_default Created 0.0s
⠿ Container auxeng-docs-develop-1 Created 0.0s
Attaching to auxeng-docs-develop-1
auxeng-docs-develop-1 | success compile gatsby files - 1.308s
[...]
success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 0.830s - 9/9 10.85/s
⠀
You can now view auxeng-docs in the browser.
⠀
Local: http://localhost:8000/
On Your Network: http://192.168.0.2:8000/
⠀
View GraphiQL, an in-browser IDE, to explore your site's data and schema
⠀
Local: http://localhost:8000/___graphql
On Your Network: http://192.168.0.2:8000/___graphql
⠀
Note that the development build is not optimized.
To create a production build, use gatsby build
⠀
success Building development bundle - 20.909s
success Writing page-data.json files to public directory - 0.092s - 3/26
auxeng-docs-develop-1 | 283.89/s
auxeng-docs-develop-1 |
Also confirmed the gastby CLI works via docker-compose run gatsby info:
NOTE: I was unable to find a way to keep the volumes section in docker-compose.yml without running into subsequent yarn build errors, even when including COPY instructions within the Dockerfile and accounting for relative/absolute pathing, etc. So, the configuration as-is will likely not support hot-reloads, but we could always file this as a future enhancement and still get some degree of Docker functionality in the meantime.
Fixes #5.
Changes
Dockerfile
to support the new Gatsby + Yarn toolchain with the latest stablenode-alpine
imagedocker-compose.yml
file to support changes to theDockerfile
develop
service for local containerized developmentgatsby
service for interacting with the Gatsby CLIConfirmed
gatsby
cleanly builds and runs without issue in a container viadocker-compose build develop && docker-compose up develop
:Also confirmed the
gastby
CLI works viadocker-compose run gatsby info
:NOTE: I was unable to find a way to keep the
volumes
section indocker-compose.yml
without running into subsequentyarn build
errors, even when includingCOPY
instructions within theDockerfile
and accounting for relative/absolute pathing, etc. So, the configuration as-is will likely not support hot-reloads, but we could always file this as a future enhancement and still get some degree of Docker functionality in the meantime.