Add firebase
This commit is contained in:
parent
d9d8d03c36
commit
ad73596967
7 changed files with 35 additions and 121 deletions
5
frontend/.firebaserc
Normal file
5
frontend/.firebaserc
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"projects": {
|
||||
"default": "decla-red"
|
||||
}
|
||||
}
|
||||
1
frontend/.gitignore
vendored
1
frontend/.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
dist
|
||||
node_modules
|
||||
package-lock.json
|
||||
.firebase
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
FROM schmelczera/error-pages as build-error-pages
|
||||
RUN python build.py 403 404 50x
|
||||
|
||||
|
||||
FROM node:latest as build-webpage
|
||||
WORKDIR /home/node
|
||||
|
||||
COPY src src
|
||||
COPY static static
|
||||
COPY package.json custom.d.ts tsconfig.json webpack.config.js ./
|
||||
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
HEALTHCHECK --interval=1m --timeout=10s CMD curl --fail http://localhost/ || exit 1
|
||||
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
RUN rm -rf *
|
||||
COPY --from=build-webpage /home/node/dist .
|
||||
COPY --from=build-error-pages /home/python/built errors
|
||||
RUN find . -type f | xargs gzip -k9 &&\
|
||||
chmod -R 555 .
|
||||
|
||||
COPY nginx-config /etc/nginx/
|
||||
16
frontend/firebase.json
Normal file
16
frontend/firebase.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"hosting": {
|
||||
"public": "dist",
|
||||
"ignore": [
|
||||
"firebase.json",
|
||||
"**/.*",
|
||||
"**/node_modules/**"
|
||||
],
|
||||
"rewrites": [
|
||||
{
|
||||
"source": "**",
|
||||
"destination": "/index.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
server_tokens off;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
access_log off;
|
||||
|
||||
sendfile on;
|
||||
sendfile_max_chunk 1m;
|
||||
tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 10240;
|
||||
gzip_proxied any;
|
||||
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location ~* \.(jpg|jpeg|png|ico)$ {
|
||||
expires 30d;
|
||||
}
|
||||
|
||||
error_page 403 /403.html;
|
||||
error_page 404 /404.html;
|
||||
error_page 500 501 502 503 504 /50x.html;
|
||||
|
||||
location ~ ^/(403|404|50x).html$ {
|
||||
root /usr/share/nginx/html/errors;
|
||||
internal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
"css-loader": "^3.5.2",
|
||||
"cssnano": "^4.1.10",
|
||||
"eslint": "^7.2.0",
|
||||
"sdf-2d": "^0.1.0-alpha",
|
||||
"sdf-2d": "^0.3.4",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-import": "^2.21.2",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue