Giter Site home page Giter Site logo

gatsby-docker's People

Contributors

aaaakshat avatar aslafy-z avatar cusspvz avatar grzegorz-wcislo avatar halkeye avatar jpavlicek avatar kanolato avatar kyleamathews avatar mfeltscher avatar oluwalogoye avatar rampantrami avatar rroslaniec avatar srijanprakash avatar torenware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gatsby-docker's Issues

minor typos

I have found some typos in the readme file of this repo.
I am opening this issue to link a PR later.

I am a beginner. Please accept my naive contribution. Thanks.

Docker image outdated

It is confusing, that the Docker image with latest does not represent the source of the master branch. Can someone build a new Docker image from HEAD? This is especially important, because there is a fix missing in there (c6671d4).

About cache control

Hi, I have some questions about the default cache control.

The default en variables indicat that all js files will be cached public and expire 1 year. But gatsby doc suggest sw.js shoud be uncachable:

The only exception to this is the file /sw.js, which needs to be revalidated upon each load to check if a new version of the site is available. This file is generated by gatsby-plugin-offline and other service worker plugins, in order to serve content offline. Its cache-control header should be cache-control: public, max-age=0, must-revalidate1

And the doc also says json files should be uncachable too:

Similar to HTML files, the JSON files in the public/page-data/ directory should never be cached by the browser.

How can I achieve this? I try the following, but didn't work:
- CACHE_IGNORE=html|page-data\.json|sw\.js
- CACHE_IGNORE=html|page-data.json|sw.js

If just use json, the json files work, but how to specify sw.js?
- CACHE_IGNORE=html|json|sw.js

Thanks!

nginx config generated by nginx-boot.sh does bogus 301 redirects

Creating an image using nginx-boot.sh as directed does not work if you are using port redirection in docker.

Procedure to reproduce:

  1. Set up a gatsby project that uses markup files to generate pages.
  2. Build a docker image, e.g.
    docker build -t test-gatsby .
    
  3. Get a coffee, that's gonna take a while.
  4. Once it builds, start up the image, setting a non-standard port:
    docker run --name k8s-test -d -p 8001:80 test-gatsby:latest
    
  5. Verify your index page works by going to http://localhost:8001/
  6. Open the Network tab of your dev tools.
  7. Go to the URI of one of your built images.
  8. Result for me was a 301 redirecting from http://localhost:8001/PATH to http://localhost/PATH. Since only 8001 is active, this will appear as connection refused immediately after the 301.

Port-mapping doesn't work

Running this command:

docker run -d --rm myproject/website . exposes no site on localhost...

but

docker run -d -p 80:80 --rm myproject/website . does.

Am I just being clueless about how Docker works?

500 Server Error when running via Docker

I have a working gatsbyjs project that doesn't run from the official Docker image.

This is the Dockerfile (based on a related issue.

FROM gatsbyjs/gatsby:latest
ADD public/ /pub

(the compiled website is at public/ and I've confirmed the index.html renders the website correctly)

I also tried the official Dockerfile, which didn't work:

FROM gatsbyjs/gatsby:onbuild

I'm running this from docker-compose as follows:

version: '3'

services:
  website:
    build: .
    ports:
      - "80:80"

Nginx returns a "500 Internal Server Error".

I'm following the official tutorial here.

This is also submitted as a StackOverflow question here.

how to use onbuild?

If I follow the documentation, I create a Dockerfile containing:

FROM gatsbyjs/gatsby:onbuild
RUN gatsby build

This will will output:

Sending build context to Docker daemon  198.1MB
Step 1/2 : FROM gatsbyjs/gatsby:onbuild
# Executing 1 build trigger
 ---> e5cc71f754ba
Step 2/2 : RUN gatsby build
 ---> Running in 18b3c4f0d471
/bin/sh: gatsby: not found
The command '/bin/sh -c gatsby build' returned a non-zero code: 127

what am I doing wrong? How to set up a correct Dockerfile for building?

doesn't work under service worker

if i start from index page and then move in to other pages it works but if i refresh in other page then homepage so like request is /app/login it returns 404

Doesn't actually include Gatsby?

This looks like it's just an nginx container? I'm trying to get a Docker container that works with v2 of Gatsby.

I have been using this container but it's a bit outdated. I ran into some issues but since it's running Gatsby v1.9.x and not ^2.0.0, I can't be sure that it's not already been fixed(afaik v2 introduced quite a few changes).

#11 (Gatsby CLI so it can be used for development) has been in discussion for a while and there is a PR that recently got some feedback but it's not clear if that'll be sussed out any time soon. So in the meantime I went to the PR repo and copied their Dockerfile, like I had tried with the prior one I had been using, but attempting to build both fails because of vips-dev requiring fttw3?

I'm going to give up on an alpine build as I've spent over 8 hours trying different Dockerfile changes to resolve the issue and get a working build but can't seem to get a container with v2 working :\

Docker build fails on the first line

Снимок экрана 2020-04-18 в 20 21 38

My file structure looks like this and there is no "app" folder. I just copied Dockerfile and .dockerignore to the root and tried to build according to the readme.

I am getting the following error

Sending build context to Docker daemon  1.384MB
Step 1/3 : FROM gatsbyjs/gatsby:onbuild as build
# Executing 1 build trigger
ADD failed: stat /var/lib/docker/tmp/docker-builder611750273/public: no such file or directory

Image at docker store is not working

Hi!

Nice project.

I recently run the image and this is the error.

docker run --rm gatsbyjs/gatsby /sbin/nginx-boot: line 83: syntax error near unexpected token then'
/sbin/nginx-boot: line 83: if [ "" != "$DEBUG" ]; then'

Opening the file with:
docker run --rm -it gatsbyjs/gatsby vi /sbin/nginx-boot

I saw that there are .. in between the if and [.
Using cat I can't see that.

After modify that the error is:

bash-4.3# nginx-boot nginx: [emerg] open() "/run/nginx/nginx.pid" failed (2: No such file or directory)

If I create the /run/nginx directory, nginx works, but not yet gatsby.

CLI / Dev image

Image doesn't actually provide Gatsby in a way that can be used for development via Docker.

@gatsbybot has closed two similar issues. It's a bit broken as it closes issues regardless of activity and states you can re-open the issue, but the issue author is not able to actually do so.

#11
#24

Should be noted that alpine isn't a good candidate for dev image at present. Numerous issues detailed in the related PR. Official node images have debian stretch slim available, it should work alright despite having packages a fair bit outdated(2015), Buster will arrive later this year. Official node images are also considering adding Ubuntu as a base option too.

Gatsby 4 support

Hello friends.

This docker image is not enough anymore to run a Gatsby 4 site, since it does not allow for the Render modes. It should gatsby serve, not only nginx the public folder.

Or even better, there would be a docker image that uses web workers similar to Gatsby Cloud.

What would be the future for Gatsby-docker?

500 Server Error

Possibly related to #13

Running docker run -d -p 80:80 --rm myproject/website . , and then visiting localhost, leads me to a page with "500 Internal Server Error / nginx"

Which docker file?

Docs say:

Insert the Dockerfile above at the root of your project

Above (repository contents) are two Dockerfiles, below is one line of a Dockerfile.

ERROR [build 2/1] ADD public/ /pub

First time using gatsby-docker it just crashes by following your readme. What am I missing here?

[+] Building 3.0s (9/10)
 => [internal] load build definition from Dockerfile                                                                                                                                                                    0.0s
 => => transferring dockerfile: 527B                                                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                                                       0.0s
 => => transferring context: 34B                                                                                                                                                                                        0.0s
 => [internal] load metadata for docker.io/gatsbyjs/gatsby:latest                                                                                                                                                       2.9s
 => [internal] load metadata for docker.io/gatsbyjs/gatsby:onbuild                                                                                                                                                      2.8s
 => [auth] gatsbyjs/gatsby:pull token for registry-1.docker.io                                                                                                                                                          0.0s
 => [stage-1 1/2] FROM docker.io/gatsbyjs/gatsby@sha256:fa8b71211a1ae2d3a3f53c1a8c73cd6aa563b02e5c7d2e70975fed65e55af712                                                                                                0.0s
 => => resolve docker.io/gatsbyjs/gatsby@sha256:fa8b71211a1ae2d3a3f53c1a8c73cd6aa563b02e5c7d2e70975fed65e55af712                                                                                                        0.0s
 => [internal] load build context                                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                                         0.0s
 => CANCELED [build 1/1] FROM docker.io/gatsbyjs/gatsby:onbuild@sha256:cc6f390975708bee5b4dc9a2a4812b8e8bfb2ded1bb5c3107be91150e97ccb50                                                                                 0.0s
 => => resolve docker.io/gatsbyjs/gatsby:onbuild@sha256:cc6f390975708bee5b4dc9a2a4812b8e8bfb2ded1bb5c3107be91150e97ccb50                                                                                                0.0s
 => => sha256:cc6f390975708bee5b4dc9a2a4812b8e8bfb2ded1bb5c3107be91150e97ccb50 947B / 947B                                                                                                                              0.0s
 => => sha256:d584dc12fdde1770d771137dfecff12d53ae522fadd6ae7915c08864d6401dd7 3.32kB / 3.32kB                                                                                                                          0.0s
 => ERROR [build 2/1] ADD public/ /pub``
`

HTTPS?

Looking at the README I see that I can run the app on an HTTP port. How is it suggested that I use HTTPS instead?

Dockerhub image is outdated

This is the nginx config from the current docker image:
image

Which is wrong because it causes an infinite loop. This is fine in master branch.

Pull access denied for gatsby

Tried to pull image and I'm getting this error,

will creating a login at docker hub fix this or do i need further permissions

thank you in advanced

''Unable to find image 'gatsby:latest' locally
ddocker: Error response from daemon: pull access denied for gatsby, repository does not exist or may require 'docker login'.''

Update images in docker hub

Hello.

After debugging why my gatsby project doesn't build with these instructions I found out that docker hub has not been updated with the latest image.

Last Travis job #24 was run two months ago.

allow overrides in nginx configuration

as the configuration file is set now, it is impossible to http add headers because the hardcoded location directives precede the customization part. I propose to put the custom environment variable $CUSTOM_SERVER_CONFIG before the location sections.

Feat: Cache webp images

The updated gatsby-plugin-image plugin generated webp images. Those are currently not cached by the user browser because of the missing nginx configuration

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.