rename nginx.conf -> default.conf, update Dockerfile (use nginx config templates instead of overriding the nginx.conf, bump nginx/node version), rename SEO -> Seo,
This commit is contained in:
parent
bf43b1b27a
commit
698aabed17
|
@ -2,11 +2,12 @@ version: 2
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:12.9.1-browsers
|
- image: circleci/node:14.16.1-browsers
|
||||||
working_directory: ~/dwysokinski
|
working_directory: ~/dwysokinski
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- setup_remote_docker
|
- setup_remote_docker:
|
||||||
|
version: 20.10.2
|
||||||
# start proprietary DB using private Docker image
|
# start proprietary DB using private Docker image
|
||||||
# with credentials stored in the UI
|
# with credentials stored in the UI
|
||||||
- run: |
|
- run: |
|
||||||
|
@ -25,4 +26,4 @@ workflows:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
26
Dockerfile
26
Dockerfile
|
@ -1,10 +1,22 @@
|
||||||
FROM node:14.1.0-alpine as build-deps
|
FROM node:14.16.1-alpine as build-deps
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
#Stage 1
|
RUN apk --no-cache add shadow \
|
||||||
|
gcc \
|
||||||
RUN npm install --global gatsby-cli
|
musl-dev \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
make \
|
||||||
|
libtool \
|
||||||
|
nasm \
|
||||||
|
tiff \
|
||||||
|
jpeg \
|
||||||
|
zlib \
|
||||||
|
zlib-dev \
|
||||||
|
file \
|
||||||
|
pkgconf
|
||||||
|
RUN npm install --global gatsby-cli@3.3.0
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn
|
RUN yarn
|
||||||
|
@ -13,8 +25,8 @@ RUN yarn build
|
||||||
|
|
||||||
#Stage 2
|
#Stage 2
|
||||||
|
|
||||||
FROM nginx:1.17.5-alpine
|
FROM nginx:1.20-alpine
|
||||||
COPY --from=build-deps /usr/src/app/public /var/www
|
COPY --from=build-deps /usr/src/app/public /var/www
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY default.conf /etc/nginx/templates/default.conf.template
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
server {
|
||||||
|
# listen on port 80
|
||||||
|
listen 80;
|
||||||
|
# save logs here
|
||||||
|
access_log /var/log/nginx/access.log combined;
|
||||||
|
|
||||||
|
# where the root here
|
||||||
|
root /var/www;
|
||||||
|
# what file to server as index
|
||||||
|
index index.html index.htm;
|
||||||
|
error_page 404 /404/index.html;
|
||||||
|
|
||||||
|
# Fonts and media: images, icons, video, audio, HTC
|
||||||
|
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|ttf)$ {
|
||||||
|
expires 1M;
|
||||||
|
add_header Cache-Control "public";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Javascript and CSS files
|
||||||
|
location ~* \.(?:css|webmanifest|js|woff2|manifest)$ {
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public";
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
# First attempt to serve request as file, then
|
||||||
|
# as directory, then fall back to redirecting to index.html
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,7 +37,16 @@ module.exports = {
|
||||||
{
|
{
|
||||||
resolve: `gatsby-theme-material-ui`,
|
resolve: `gatsby-theme-material-ui`,
|
||||||
options: {
|
options: {
|
||||||
webFontsConfig: null,
|
webFontsConfig: {
|
||||||
|
fonts: {
|
||||||
|
google: [
|
||||||
|
{
|
||||||
|
family: `Montserrat`,
|
||||||
|
variants: [`300`],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
`gatsby-plugin-sitemap`,
|
`gatsby-plugin-sitemap`,
|
||||||
|
|
62
nginx.conf
62
nginx.conf
|
@ -1,62 +0,0 @@
|
||||||
# auto detects a good number of processes to run
|
|
||||||
worker_processes auto;
|
|
||||||
|
|
||||||
#Provides the configuration file context in which the directives that affect connection processing are specified.
|
|
||||||
events {
|
|
||||||
# Sets the maximum number of simultaneous connections that can be opened by a worker process.
|
|
||||||
worker_connections 8000;
|
|
||||||
# Tells the worker to accept multiple connections at a time
|
|
||||||
multi_accept on;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
http {
|
|
||||||
# what times to include
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
# what is the default one
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
# Sets the path, format, and configuration for a buffered log write
|
|
||||||
log_format compression '$remote_addr - $remote_user [$time_local] '
|
|
||||||
'"$request" $status $upstream_addr '
|
|
||||||
'"$http_referer" "$http_user_agent"';
|
|
||||||
|
|
||||||
server {
|
|
||||||
# listen on port 80
|
|
||||||
listen 80;
|
|
||||||
# save logs here
|
|
||||||
access_log /var/log/nginx/access.log compression;
|
|
||||||
|
|
||||||
# where the root here
|
|
||||||
root /var/www;
|
|
||||||
# what file to server as index
|
|
||||||
index index.html index.htm;
|
|
||||||
error_page 404 /404/index.html;
|
|
||||||
|
|
||||||
# Fonts and media: images, icons, video, audio, HTC
|
|
||||||
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|ttf)$ {
|
|
||||||
expires 1M;
|
|
||||||
access_log off;
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Javascript and CSS files
|
|
||||||
location ~* \.(?:css|webmanifest|js|woff2|manifest)$ {
|
|
||||||
try_files $uri =404;
|
|
||||||
expires 1y;
|
|
||||||
access_log off;
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
# First attempt to serve request as file, then
|
|
||||||
# as directory, then fall back to redirecting to index.html
|
|
||||||
try_files $uri $uri/ =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Any route containing a file extension (e.g. /devicesfile.js)
|
|
||||||
location ~ ^.+\..+$ {
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
24
package.json
24
package.json
|
@ -12,21 +12,21 @@
|
||||||
"babel-plugin-module-resolver": "^4.0.0",
|
"babel-plugin-module-resolver": "^4.0.0",
|
||||||
"babel-plugin-transform-imports": "^2.0.0",
|
"babel-plugin-transform-imports": "^2.0.0",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"gatsby": "^2.23.12",
|
"gatsby": "^3.3.1",
|
||||||
"gatsby-background-image": "^1.1.1",
|
"gatsby-background-image": "^1.1.1",
|
||||||
"gatsby-image": "^2.4.9",
|
"gatsby-image": "^3.3.0",
|
||||||
"gatsby-plugin-manifest": "^2.4.14",
|
"gatsby-plugin-manifest": "^3.3.0",
|
||||||
"gatsby-plugin-offline": "^3.2.13",
|
"gatsby-plugin-offline": "^4.3.0",
|
||||||
"gatsby-plugin-react-helmet": "^3.3.6",
|
"gatsby-plugin-react-helmet": "^4.3.0",
|
||||||
"gatsby-plugin-robots-txt": "^1.5.1",
|
"gatsby-plugin-robots-txt": "^1.5.1",
|
||||||
"gatsby-plugin-sharp": "^2.6.14",
|
"gatsby-plugin-sharp": "^3.3.1",
|
||||||
"gatsby-plugin-sitemap": "^2.4.11",
|
"gatsby-plugin-sitemap": "^3.3.0",
|
||||||
"gatsby-source-filesystem": "^2.3.14",
|
"gatsby-source-filesystem": "^3.3.0",
|
||||||
"gatsby-theme-material-ui": "^1.0.10",
|
"gatsby-theme-material-ui": "^2.0.1",
|
||||||
"gatsby-transformer-sharp": "^2.5.7",
|
"gatsby-transformer-sharp": "^3.3.0",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react": "^16.12.0",
|
"react": "^17.0.1",
|
||||||
"react-dom": "^16.12.0",
|
"react-dom": "^17.0.1",
|
||||||
"react-helmet": "^6.1.0"
|
"react-helmet": "^6.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Helmet } from 'react-helmet';
|
||||||
import { useStaticQuery, graphql } from 'gatsby';
|
import { useStaticQuery, graphql } from 'gatsby';
|
||||||
import ogThumbnail from '@images/og_thumbnail.png';
|
import ogThumbnail from '@images/og_thumbnail.png';
|
||||||
|
|
||||||
function SEO({ description, lang, meta, title, pathname }) {
|
function Seo({ description, lang, meta, title, pathname }) {
|
||||||
const { site } = useStaticQuery(
|
const { site } = useStaticQuery(
|
||||||
graphql`
|
graphql`
|
||||||
query {
|
query {
|
||||||
|
@ -68,7 +68,7 @@ function SEO({ description, lang, meta, title, pathname }) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
property: `og:locale`,
|
property: `og:locale`,
|
||||||
content: `pl`,
|
content: `en`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `twitter:creator`,
|
name: `twitter:creator`,
|
||||||
|
@ -108,17 +108,17 @@ function SEO({ description, lang, meta, title, pathname }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SEO.defaultProps = {
|
Seo.defaultProps = {
|
||||||
lang: `pl`,
|
lang: `pl`,
|
||||||
meta: [],
|
meta: [],
|
||||||
description: ``,
|
description: ``,
|
||||||
};
|
};
|
||||||
|
|
||||||
SEO.propTypes = {
|
Seo.propTypes = {
|
||||||
description: PropTypes.string,
|
description: PropTypes.string,
|
||||||
lang: PropTypes.string,
|
lang: PropTypes.string,
|
||||||
meta: PropTypes.arrayOf(PropTypes.object),
|
meta: PropTypes.arrayOf(PropTypes.object),
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SEO;
|
export default Seo;
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { Divider } from '@material-ui/core';
|
import { Divider } from '@material-ui/core';
|
||||||
import Layout from '@components/Layout/Layout';
|
import Layout from '@components/Layout/Layout';
|
||||||
import SEO from '@components/SEO';
|
import Seo from '@components/Seo';
|
||||||
import Header from './components/Header';
|
import Header from './components/Header';
|
||||||
import MyPriorities from './components/MyPriorities/MyPriorities';
|
import MyPriorities from './components/MyPriorities/MyPriorities';
|
||||||
import Technologies from './components/Technologies/Technologies';
|
import Technologies from './components/Technologies/Technologies';
|
||||||
|
@ -20,7 +20,7 @@ const HomePage = ({ location }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<Layout className={classes.layout} navbarProps={{ position: 'absolute' }}>
|
<Layout className={classes.layout} navbarProps={{ position: 'absolute' }}>
|
||||||
<SEO pathname={location.pathname} />
|
<Seo pathname={location.pathname} />
|
||||||
<Header />
|
<Header />
|
||||||
<MyPriorities />
|
<MyPriorities />
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import isSmoothScrollSupported from '@utils/isSmoothScrollSupported';
|
import isSmoothScrollSupported from '@utils/isSmoothScrollSupported';
|
||||||
|
|
||||||
export default () => {
|
const useSmoothScroll = () => {
|
||||||
return id => e => {
|
return id => e => {
|
||||||
if (isSmoothScrollSupported()) {
|
if (isSmoothScrollSupported()) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -12,3 +12,5 @@ export default () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default useSmoothScroll;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { Container, Typography } from '@material-ui/core';
|
import { Container, Typography } from '@material-ui/core';
|
||||||
import { Link } from 'gatsby-theme-material-ui';
|
import { Link } from 'gatsby-theme-material-ui';
|
||||||
import Layout from '@components/Layout/Layout';
|
import Layout from '@components/Layout/Layout';
|
||||||
import SEO from '@components/SEO';
|
import Seo from '@components/Seo';
|
||||||
|
|
||||||
const useStyles = makeStyles(() => ({
|
const useStyles = makeStyles(() => ({
|
||||||
container: {
|
container: {
|
||||||
|
@ -24,7 +24,7 @@ const NotFoundPage = ({ location }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout className={classes.layout} showNavbar={false} showFooter={false}>
|
<Layout className={classes.layout} showNavbar={false} showFooter={false}>
|
||||||
<SEO
|
<Seo
|
||||||
title="Page not found"
|
title="Page not found"
|
||||||
description="Page not found"
|
description="Page not found"
|
||||||
pathname={location.pathname}
|
pathname={location.pathname}
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
export default () => 'scrollBehavior' in document.documentElement.style;
|
const isSmoothScrollSupported = () =>
|
||||||
|
'scrollBehavior' in document.documentElement.style;
|
||||||
|
|
||||||
|
export default isSmoothScrollSupported;
|
||||||
|
|
Loading…
Reference in New Issue