parent
7ef3a0fc81
commit
9134fa9adf
@ -0,0 +1,21 @@
|
||||
FROM node:alpine as builder
|
||||
|
||||
WORKDIR /build
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
|
||||
RUN npm install && mkdir /ng-app && cp -r node_modules/ /ng-app
|
||||
|
||||
WORKDIR /ng-app
|
||||
COPY frontend .
|
||||
|
||||
RUN $(npm bin)/ng build --prod --build-optimizer
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
COPY --from=builder /ng-app/dist /srv/http
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
@ -0,0 +1,10 @@
|
||||
FROM python:alpine
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
RUN pip install --no-cache-dir --requirement requirements.txt
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
ENTRYPOINT ["python", "app.py"]
|
@ -0,0 +1,5 @@
|
||||
Flask
|
||||
Flask-Login
|
||||
Flask-RESTful
|
||||
Flask-SQLAlchemy
|
||||
itsdangerous
|
@ -1,9 +0,0 @@
|
||||
DESTINATION = /srv/http/quotes/quotes
|
||||
BUILD_FLAGS = --prod --build-optimizer
|
||||
|
||||
.PHONY: all quotes
|
||||
|
||||
all: quotes
|
||||
|
||||
quotes:
|
||||
ng build $(BUILD_FLAGS) --output-path $(DESTINATION)
|
@ -0,0 +1,64 @@
|
||||
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;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /srv/http;
|
||||
index index.html;
|
||||
}
|
||||
|
||||
location /api {
|
||||
rewrite ^/api(/.*)$ $1 break;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_http_version 1.1;
|
||||
tcp_nodelay on;
|
||||
proxy_pass http://api:5000/;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
location = /404.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue