-
-
Save opchaves/eff16c780db98ecf48f88e7cb9208456 to your computer and use it in GitHub Desktop.
Gatsby Dockerfile
This file contains hidden or 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
.cache/ | |
node_modules/ | |
public/ |
This file contains hidden or 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
server { | |
listen 80; | |
root /usr/share/nginx/html; | |
index index.html; | |
autoindex off; | |
charset urtf-8; | |
error_page 404 /404.html; | |
location ~* \.(html)$ { | |
add_header Cache-Control "no-store"; | |
expires off; | |
} | |
rewrite ^([^.\?]*[^/])$ $1/ permanent; | |
try_files $uri $uri/ $uri/index.html =404; | |
} |
This file contains hidden or 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:13.8.0 as front | |
WORKDIR /app | |
COPY ./ /app/ | |
RUN yarn install | |
RUN yarn run build | |
FROM nginx:1.17.8-alpine | |
RUN rm -rf /usr/share/nginx/html | |
COPY --from=front /app/public/ /usr/share/nginx/html | |
COPY docker/vhost.conf /etc/nginx/conf.d/default.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment