Last active
August 17, 2021 04:59
-
-
Save NogaMan/3ae6bd88e8ae063ab6da56bc36659c7d 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 default.conf /etc/nginx/conf.d/default.conf |
Step 9/9 : COPY docker/vhost.conf /etc/nginx/conf.d/default.conf
COPY failed: stat /var/lib/docker/tmp/docker-builder697431010/docker/vhost.conf: no such file or directory
Change the line 12 of the Dockerfile (COPY docker/vhost.conf /etc/nginx/conf.d/default.conf
) with the followingCOPY default.conf /etc/nginx/conf.d/default.conf
UPD: I edited this gist with the fixed line
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get:
Step 9/9 : COPY docker/vhost.conf /etc/nginx/conf.d/default.conf
COPY failed: stat /var/lib/docker/tmp/docker-builder704808398/docker/vhost.conf: no such file or directory
error Command failed with exit code 1.