From 4fe21ccc2eaa77012f542cf0e1a8672957ea70d8 Mon Sep 17 00:00:00 2001 From: Ceddy Muhoza Date: Mon, 27 May 2019 20:52:08 -0400 Subject: [PATCH] Docker --- .dockerignore | 3 +++ Dockerfile | 25 +++++++++++-------------- src/pages/_document.tsx | 2 +- src/screens/Ats/AtsScreen.tsx | 4 +++- src/screens/Ats/SEO.tsx | 9 +++++++++ src/static/css/moving-stars.css | 2 +- 6 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 src/screens/Ats/SEO.tsx diff --git a/.dockerignore b/.dockerignore index 85dcc16..4bf5fa6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,5 @@ .git node_modules +build +.next + diff --git a/Dockerfile b/Dockerfile index ae1d2f7..6911225 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,16 @@ -FROM node:10.15.1-alpine +FROM mhart/alpine-node:10 AS builder -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app +WORKDIR /srv -COPY package.json yarn.lock /usr/src/app/ -RUN YARN_CACHE_FOLDER=/dev/shm/yarn_cache yarn --production -ENV NODE_ICU_DATA=/usr/src/app/node_modules/full-icu - -COPY .next /usr/src/app/.next -COPY locales /usr/src/app/locales -COPY build /usr/src/app/build -COPY src/static /usr/src/app/build/static +COPY ./ ./ +# RUN apk add --no-cache make gcc g++ python +RUN yarn +RUN yarn build +# use lighter image +FROM mhart/alpine-node:base-10 +COPY --from=builder /srv . +ENV NODE_ENV=production EXPOSE 3000 +CMD ["node", "build/server.js"] -USER node - -CMD [ "yarn", "start" ] diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index a81a7f1..236aa54 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -115,7 +115,7 @@ export default class MyDocument extends Document<{ /> )} */} - +
diff --git a/src/screens/Ats/AtsScreen.tsx b/src/screens/Ats/AtsScreen.tsx index 1865d06..bd583d2 100644 --- a/src/screens/Ats/AtsScreen.tsx +++ b/src/screens/Ats/AtsScreen.tsx @@ -2,6 +2,7 @@ import React from "react"; import Head from "next/head"; import styled from "styled-components"; import dynamic from "next/dynamic"; +import { SEO } from "./SEO"; const GitHubButton = dynamic(import("react-github-btn"), { ssr: false, @@ -17,9 +18,10 @@ const GitHubContainer = styled.div` export const AtsScreen = () => { return ( -
+
{/* Inject CSS files */} + diff --git a/src/screens/Ats/SEO.tsx b/src/screens/Ats/SEO.tsx new file mode 100644 index 0000000..031dab9 --- /dev/null +++ b/src/screens/Ats/SEO.tsx @@ -0,0 +1,9 @@ +import React, { Fragment } from "react"; + +export const SEO = () => { + return ( + + Create your own internet + + ); +}; diff --git a/src/static/css/moving-stars.css b/src/static/css/moving-stars.css index acf6b16..5657cff 100644 --- a/src/static/css/moving-stars.css +++ b/src/static/css/moving-stars.css @@ -2,7 +2,7 @@ display: block; position: relative; width: 100%; - height: 100%; + height: 100vh; overflow: hidden; background: linear-gradient(to bottom, #020107 0%, #201b46 100%); }