nginx + dockerfile update
This commit is contained in:
1 parent
1b77f6b2de
commit
fee7a4f6da
2 files changed
+54
-65
No files matched your search
+42
-21
@@ -1,27 +1,48 @@
|
|||||||
# Build
|
# # Build
|
||||||
FROM node:10 as build
|
# FROM node:10 as build
|
||||||
WORKDIR /app
|
# WORKDIR /app
|
||||||
|
|
||||||
COPY package.json package-lock.json ./
|
# COPY package.json package-lock.json ./
|
||||||
RUN npm i
|
# RUN npm i
|
||||||
COPY webpack.config.js gulpfile.js .babelrc ./
|
# COPY webpack.config.js gulpfile.js .babelrc ./
|
||||||
COPY robots.txt ./
|
# COPY robots.txt ./
|
||||||
COPY src ./src
|
# COPY src ./src
|
||||||
RUN npm run gulp
|
# RUN npm run gulp
|
||||||
RUN npm run build-app
|
# RUN npm run build-app
|
||||||
RUN npm run out
|
# RUN npm run out
|
||||||
|
|
||||||
|
|
||||||
|
# # Run
|
||||||
|
# FROM node:8-alpine
|
||||||
|
# WORKDIR /app
|
||||||
|
|
||||||
|
# COPY package.json package-lock.json ./
|
||||||
|
# RUN npm i --production
|
||||||
|
|
||||||
|
# COPY --from=build /app/out ./src
|
||||||
|
# COPY --from=build /app/public ./public
|
||||||
|
|
||||||
|
# EXPOSE 3000
|
||||||
|
|
||||||
|
# CMD npm start
|
||||||
|
|
||||||
|
|
||||||
|
# FROM node:12-alpine as build
|
||||||
|
# WORKDIR /app
|
||||||
|
|
||||||
|
# COPY package.json package-lock.json ./
|
||||||
|
# RUN npm ci
|
||||||
|
|
||||||
|
# COPY . .
|
||||||
|
# RUN npm run build
|
||||||
|
# RUN npm run start & npm run export
|
||||||
|
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
FROM node:8-alpine
|
FROM nginx:stable-alpine
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY package.json package-lock.json ./
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
RUN npm i --production
|
|
||||||
|
|
||||||
COPY --from=build /app/out ./src
|
WORKDIR /usr/share/nginx/html
|
||||||
COPY --from=build /app/public ./public
|
# COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
COPY ./dist /usr/share/nginx/html
|
||||||
EXPOSE 3000
|
|
||||||
|
|
||||||
CMD npm start
|
|
||||||
+12
-44
@@ -1,48 +1,16 @@
|
|||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 80;
|
||||||
charset utf-8;
|
server_name localhost;
|
||||||
|
charset utf-8;
|
||||||
server_name art.shlisselburg.org;
|
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/art.shlisselburg.org/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/art.shlisselburg.org/privkey.pem;
|
|
||||||
|
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
||||||
ssl_prefer_server_ciphers on;
|
|
||||||
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://hudozka;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection $connection_upgrade;
|
|
||||||
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_log /var/log/nginx/art.shburg.error.log;
|
|
||||||
access_log /var/log/nginx/art.shburg.access.log;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name art.shlisselburg.org art.shburg.org;
|
|
||||||
|
|
||||||
location ^~ /.well-known/acme-challenge {
|
|
||||||
root /home/hoster/www/art.shburg.org/public;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
return 301 https://art.shlisselburg.org$request_uri;
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
try_files $uri $uri.html $uri/index.html =404;
|
||||||
}
|
}
|
||||||
}
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
map $http_upgrade $connection_upgrade {
|
}
|
||||||
default upgrade;
|
# redirect server error pages to the static page /50x.html
|
||||||
'' close;
|
#
|
||||||
}
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
|
||||||
upstream hudozka {
|
|
||||||
server localhost:1800;
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user