1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Server static on nginx

This commit is contained in:
Maksym Pavlenko
2018-12-10 19:15:21 -08:00
parent 908e23066a
commit e724cd1189
5 changed files with 31 additions and 2 deletions

15
cmd/nginx/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
# Build fronend
FROM node:8-slim AS frontend_builder
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
# Build nginx
FROM umputun/nginx-le:latest
COPY cmd/nginx/podsync.conf /etc/nginx/service.conf
COPY cmd/nginx/robots.txt /var/www/
COPY --from=frontend_builder /app/templates/ /var/www/
COPY --from=frontend_builder /app/dist/ /var/www/assets/

View File

@@ -9,7 +9,9 @@ upstream backend {
server {
listen 443;
root /usr/share/nginx/html;
root /var/www/;
index index.html;
server_name podsync.net;
ssl on;
@@ -34,6 +36,10 @@ server {
}
location / {
try_files $uri $uri/ @backend;
}
location @backend {
proxy_pass http://backend;
proxy_buffers 8 16k;
proxy_buffer_size 16k;

4
cmd/nginx/robots.txt Normal file
View File

@@ -0,0 +1,4 @@
User-agent: *
Allow: /$
Disallow: /
Host: www.podsync.net

View File

@@ -46,7 +46,7 @@ services:
mem_limit: 268435456 # 256MB
oom_kill_disable: true
nginx:
image: umputun/nginx-le:latest
image: mxpv/nginx:latest
container_name: nginx
restart: always
ports:

4
nginx.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
docker build -t mxpv/nginx -f cmd/nginx/Dockerfile .
docker push mxpv/nginx