container-ify

This commit is contained in:
Tommy Parnell
2018-09-28 15:18:55 -04:00
parent 34baa913ad
commit 7ee7150a90
9 changed files with 3716 additions and 334 deletions

View File

@@ -1,4 +1,5 @@
{ {
"directory": "components", "directory": "components",
"json": "bower.json" "json": "bower.json",
"allow_root": true
} }

5
.dockerignore Normal file
View File

@@ -0,0 +1,5 @@
node_modules
public
db.json
components
js/bowr.js

12
Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM node:8 as build
WORKDIR /build
COPY package.json package.json
RUN npm install
COPY . .
RUN npm run bower install
RUN npm run pub
FROM nginx:mainline as runtime
COPY --from=build /build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
COPY default.conf /etc/nginx/conf.d/default.conf

19
default.conf Normal file
View File

@@ -0,0 +1,19 @@
server {
listen 80;
server_name _;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
rewrite ^(/tags/)(.*) https://$host/tag/$2/ permanent;
rewrite ^(/rss) /rss.xml break;
absolute_redirect off;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
}
error_page 500 502 503 504 /500/;
error_page 404 /404/;
}

6
docker-compose.yml Normal file
View File

@@ -0,0 +1,6 @@
version: '3'
services:
webapp:
build: ./
ports:
- "8080:80"

File diff suppressed because one or more lines are too long

32
nginx.conf Normal file
View File

@@ -0,0 +1,32 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
include /etc/nginx/conf.d/*.conf;
}

View File

@@ -4,7 +4,8 @@
"private": true, "private": true,
"scripts": { "scripts": {
"gulp": "gulp", "gulp": "gulp",
"bower": "bower" "bower": "bower",
"pub": "gulp publish"
}, },
"dependencies": { "dependencies": {
"bower": "^1.8.4", "bower": "^1.8.4",

3636
yarn.lock Normal file

File diff suppressed because it is too large Load Diff