Browse Source

Add docker image configuration

main
Marian Steinbach 4 years ago
parent
commit
edc0cc552c
  1. 2
      .dockerignore
  2. 17
      Dockerfile
  3. 3
      Makefile
  4. 39
      config/nginx.conf

2
.dockerignore

@ -0,0 +1,2 @@
node_modules
build

17
Dockerfile

@ -0,0 +1,17 @@
FROM node:10-slim AS builder
WORKDIR /
ADD yarn.lock /
ADD package.json /
ADD src /src
ADD scripts /scripts
ADD public /public
ADD config /config
RUN yarn install
RUN yarn build
FROM nginx:1.14-alpine
COPY --from=builder /build /usr/share/nginx/html
COPY config/nginx.conf /etc/nginx/nginx.conf

3
Makefile

@ -31,3 +31,6 @@ export:
--credentials-path /secrets/datastore-reader.json \
--loglevel info \
export --kind spider-results
docker-build:
docker build -t quay.io/netzbegruenung/green-spider-webapp:latest .

39
config/nginx.conf

@ -0,0 +1,39 @@
user nginx;
worker_processes 1;
error_log stderr warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
server {
listen 8000;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}
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 /dev/stdout main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
Loading…
Cancel
Save