-
-
Save araphiel/3ab68a6e3eb4843b0c746cba0bd9732f to your computer and use it in GitHub Desktop.
Gatsby.js Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GATSBY_WEBPACK_PUBLICPATH=/ | |
ENABLE_REFRESH_ENDPOINT=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10.15 as builder | |
WORKDIR /app | |
COPY . . | |
RUN npm install | |
FROM node:10.15-alpine | |
WORKDIR /app | |
COPY --from=builder app . | |
EXPOSE 8000 | |
CMD ["npm", "run", "dev", "--", "-H", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSEBDockerrunVersion": 1, | |
"Ports": [ | |
{ | |
"ContainerPort": 8000, | |
"HostPort": 8000 | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A basic setup for running your Gatsby.js project in Docker.
Run this in the cloud & you effectively have a working Gatsby preview server.
Once it's up - all you need to do is send a POST request to https://yourpreviewdomain.com/__refresh to see your data update live.
Really useful if you're using a datasource like Contentful or Wordpress.
Also included is a Dockerrun.aws.json file, in case you want to use this with Elastic Beanstalk.