From cf64b2d0409453f2247e078a75ca6bb1f2e1c6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Cort=C3=A9s?= Date: Thu, 16 Dec 2021 01:00:27 -0300 Subject: [PATCH] Listo para produccion --- Dockerfile | 20 +- nginx.conf | 26 +++ package.json | 4 +- postcss.config.js | 1 + public/favicon.png | Bin 3127 -> 0 bytes public/index.css | 515 ------------------------------------------- public/index.html | 3 +- public/tailwind.css | 3 - src/Container.svelte | 2 +- src/Link.svelte | 2 +- src/tailwind.css | 7 + 11 files changed, 57 insertions(+), 526 deletions(-) create mode 100644 nginx.conf delete mode 100644 public/favicon.png delete mode 100644 public/index.css delete mode 100644 public/tailwind.css create mode 100644 src/tailwind.css diff --git a/Dockerfile b/Dockerfile index c616cb0..bae6c00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,18 @@ -FROM nginx:latest -COPY ./public/ /usr/share/nginx/html/ +FROM node:16 as builder + +WORKDIR /usr/app/src + +COPY package.json . +COPY package-lock.json . + +RUN npm install + +COPY . . + +RUN npm run build + +################################################################## + +FROM nginx:latest as deployer +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /usr/app/src/public /usr/share/nginx/html diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..569810c --- /dev/null +++ b/nginx.conf @@ -0,0 +1,26 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html; + } + + error_page 404 /404.html; + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + gzip on; + gzip_types *; + gzip_static on; + + expires 7d; + add_header Pragma "public"; + add_header Cache-Control "public"; +} + diff --git a/package.json b/package.json index df158c1..1e6db16 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "1.0.0", "private": true, "scripts": { - "build:tailwind": "cross-env NODE_ENV=production npx postcss public/tailwind.css -o public/index.css", - "watch:tailwind": "npx postcss public/tailwind.css -o public/index.css -w", + "build:tailwind": "cross-env NODE_ENV=production npx postcss src/tailwind.css -o public/build/index.css", + "watch:tailwind": "npx postcss src/tailwind.css -o public/build/index.css -w", "build:svelte": "rollup -c", "watch:svelte": "rollup -c -w", diff --git a/postcss.config.js b/postcss.config.js index e2dc478..b9fbed5 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -2,5 +2,6 @@ module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, + ...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}) } } \ No newline at end of file diff --git a/public/favicon.png b/public/favicon.png deleted file mode 100644 index 7e6f5eb5a2f1f1c882d265cf479de25caa925645..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3127 zcmV-749N3|P)i z7)}s4L53SJCkR}iVi00SFk;`MXX*#X*kkwKs@nFGS}c;=?XFjU|G$3t^5sjIVS2G+ zw)WGF83CpoGXhLGW(1gW%uV|X7>1P6VhCX=Ux)Lb!*DZ%@I3!{Gsf7d?gtIQ%nQiK z3%(LUSkBji;C5Rfgd6$VsF@H`Pk@xtY6t<>FNR-pD}=C~$?)9pdm3XZ36N5PNWYjb z$xd$yNQR9N!dfj-Vd@BwQo^FIIWPPmT&sZyQ$v81(sCBV=PGy{0wltEjB%~h157*t zvbe_!{=I_783x!0t1-r#-d{Y?ae$Q4N_Nd^Ui^@y(%)Gjou6y<3^XJdu{rmUf-Me?)zZ>9OR&6U5H*cK; z$gUlB{g0O4gN0sLSO|Of?hU(l?;h(jA3uH!Z{EBKuV23ouU@^Y6#%v+QG;>e*E}%?wlu-NT4DG zs)z)7WbLr)vGAu(ohrKc^em@OpO&f~6_>E61n_e0_V3@{U3^O;j{`^mNCJUj_>;7v zsMs6Hu3g7+@v+lSo;=yTYFqq}jZmQ-BK8K{C4kqi_i*jBaQE(Au0607V-zKeT;EPg zX(`vrn=L+e74+-Tqeok@_`tDa$G9I|$nTU5H*2V8@y()n*zqM?J1G!-1aX;CfDC9B zTnJ#j_%*n8Q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jin4SSP%o%6+2IT#sLjQa ziyxFFz~LMjWY+_a5H!U6%a<=b7QVP^ z*90a62;bVq{?@)P6^DWd^Yilq4|YTV2Nw!Yu;a1lPI-sxR)rf@Fe5DhDP7FH zZZ%4S*1C30P;|O+jB!1;m|rXT90Sm5*RBbQN`PKu+hDD*S^yE(CdtSfg=z>u$cIj> z :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))); - margin-bottom: calc(0.5rem * var(--tw-space-y-reverse)); -} -.space-x-2 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(0.5rem * var(--tw-space-x-reverse)); - margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))); -} -.space-x-3 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(0.75rem * var(--tw-space-x-reverse)); - margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse))); -} -.border { - border-width: 1px; -} -.border-2 { - border-width: 2px; -} -.border-black { - --tw-border-opacity: 1; - border-color: rgb(0 0 0 / var(--tw-border-opacity)); -} -.bg-red-500 { - --tw-bg-opacity: 1; - background-color: rgb(239 68 68 / var(--tw-bg-opacity)); -} -.bg-blue-500 { - --tw-bg-opacity: 1; - background-color: rgb(59 130 246 / var(--tw-bg-opacity)); -} -.bg-green-500 { - --tw-bg-opacity: 1; - background-color: rgb(34 197 94 / var(--tw-bg-opacity)); -} -.p-2 { - padding: 0.5rem; -} -.py-2 { - padding-top: 0.5rem; - padding-bottom: 0.5rem; -} -.px-2 { - padding-left: 0.5rem; - padding-right: 0.5rem; -} -.font-bold { - font-weight: 700; -} -.hover\:font-bold:hover { - font-weight: 700; -} -.hover\:underline:hover { - -webkit-text-decoration-line: underline; - text-decoration-line: underline; -} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 55a1a99..7a194fa 100644 --- a/public/index.html +++ b/public/index.html @@ -7,8 +7,7 @@ - - + diff --git a/public/tailwind.css b/public/tailwind.css deleted file mode 100644 index bd6213e..0000000 --- a/public/tailwind.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; \ No newline at end of file diff --git a/src/Container.svelte b/src/Container.svelte index fd82dde..e23391d 100644 --- a/src/Container.svelte +++ b/src/Container.svelte @@ -1,7 +1,7 @@
-
+
diff --git a/src/Link.svelte b/src/Link.svelte index 2511761..2c14467 100644 --- a/src/Link.svelte +++ b/src/Link.svelte @@ -5,7 +5,7 @@ [{link.name}] \ No newline at end of file diff --git a/src/tailwind.css b/src/tailwind.css new file mode 100644 index 0000000..2b7c2cf --- /dev/null +++ b/src/tailwind.css @@ -0,0 +1,7 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +body { + font-size:20px; +} \ No newline at end of file