gatsbyjs/gatsby-docker hiện có 349 sao trên GitHub, viết chủ yếu bằng Shell. Docker image that builds and hosts a Gatsby site
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Note: this is a community maintained project and doesn't yet have support for Gatsby v3 and beyond features like Functions, SSR, and DSG
This image has two major tags:
latest - will serve your assets on production using up an nginx server
onbuild - builds your project and creates a new docker image
Usage
Create at the root of your project a Dockerfile and .dockerignore, as below:
Dockerfile
FROM gatsbyjs/gatsby:onbuild as build
FROM gatsbyjs/gatsby
COPY --from=build /app/public /pub
.dockerignore
.cache/
node_modules/
public/
The first image is going to copy your project, install dependencies and build it.
Build your project's docker image:
docker build -t myproject/website .
Upload to the registry
docker push myproject/website
Use it
docker run --rm -p 80:80 myproject/website
# Open your browser at http://localhost
Configuration
The way Nginx behaves can be configured using environment variables.
Please refer to the docker run command options for the --env-file flag where you can specify all required environment variables in a single file. This will save you from writing a potentially long docker run command. Alternatively you can use docker-compose.
Below is the complete list of available options that can be used to customize your Nginx configuration:
Environment variable
Default
Description
CACHE_IGNORE
html
Regular expression to specify which paths shouldn't be cacheable (header Cache-Control set to no-store).
Regular expression to specify which paths should be cacheable (headers Cache-Control set to public and Expires set to the value of $CACHE_PUBLIC_EXPIRATION).
CACHE_PUBLIC_EXPIRATION
1y
Time to set for header Expires. See http://nginx.org/en/docs/http/ngx_http_headers_module.html#expires
CHARSET
utf-8
Charset being used in Content-Type response header field. See http://nginx.org/en/docs/http/ngx_http_charset_module.html
CUSTOM_SERVER_CONFIG
Need to add some advanced/custom nginx config? No problem, you can inject through this environment variable. NOTE: would be discarded if /etc/nginx/server.conf is present.
DEBUG
false
If set to true the configuration is being printed before the server starts.
GZIP_LEVEL
6
Gzip compression level of a response. See http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_comp_level
MIME types in addition to text/html for which gzip compression should be enabled. See http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_types
HTTP_PORT
80
The address and / or port for IP, or the path for a UNIX-domain socket on which the server will accept requests. See http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
PUBLIC_PATH
/pub
The path to the directory from which files are being served. See http://nginx.org/en/docs/http/ngx_http_core_module.html#root
TRAILING_SLASH
true
Specifies if paths should end with a trailing slash or not. Prevents duplicated content by redirecting requests to URLs ending with a slash to its non-trailing-slash equivalent if set to true and the other way around for false.
WORKER_CONNECTIONS
1024
The maximum number of simultaneous connections that can be opened by a worker process. See http://nginx.org/en/docs/ngx_core_module.html#worker_connections
DISABLE_FILE_CACHE
false
Disables nginx's open file cache for when used with a network storage (NFS, SMB, etc)
Append rules for the server block in nginx config
You can mount a file to /etc/nginx/server.conf to extend the server block in nginx config. This could be useful if you have defined client-only routes in GatsbyJS. For example for client only rules on path /client-only the content of your mounted file should be like:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/gatsbyjs/gatsby-docker là nguồn chính thức.
gatsbyjs/gatsby-docker có bao nhiêu sao?
gatsbyjs/gatsby-docker có 349 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/gatsbyjs/gatsby-docker. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
gatsbyjs/gatsby-docker có phải mã nguồn mở không?
Có — gatsbyjs/gatsby-docker phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/gatsbyjs/gatsby-docker.
gatsbyjs/gatsby-docker có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho gatsbyjs/gatsby-docker. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
gatsbyjs/gatsby-docker có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho gatsbyjs/gatsby-docker. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
gatsbyjs/gatsby-docker còn đang phát triển không?
Commit gần nhất trên gatsbyjs/gatsby-docker là 2.8 năm trước (theo timestamp GitHub). Repo có 93 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc gatsby-docker có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về gatsby-docker.