Skip to content

Instantly share code, notes, and snippets.

@dgovil
Forked from NogaMan/.dockerignore
Created July 25, 2020 04:16
Show Gist options
  • Save dgovil/f9f50ff38e3cc6435053973b934be232 to your computer and use it in GitHub Desktop.
Save dgovil/f9f50ff38e3cc6435053973b934be232 to your computer and use it in GitHub Desktop.
Gatsby Dockerfile
.cache/
node_modules/
public/
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;
}
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