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:
15
cmd/nginx/Dockerfile
Normal file
15
cmd/nginx/Dockerfile
Normal 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/
|
@@ -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
4
cmd/nginx/robots.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
User-agent: *
|
||||
Allow: /$
|
||||
Disallow: /
|
||||
Host: www.podsync.net
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user