container init
This commit is contained in:
parent
25c1fbbd54
commit
aa64f4f2ed
|
@ -0,0 +1,15 @@
|
|||
stages:
|
||||
- deploy
|
||||
|
||||
job:
|
||||
stage: deploy
|
||||
script:
|
||||
- docker stop fecr_sambussiness
|
||||
- docker rm fecr_sambussiness
|
||||
- docker build -t fecr_sambussiness .
|
||||
- docker run -d --restart=always --network=host --name fecr_sambussiness fecr_sambussiness
|
||||
only:
|
||||
- master
|
||||
tags:
|
||||
- fecr_sambussiness
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
FROM node:10
|
||||
COPY ./ /app
|
||||
WORKDIR /app
|
||||
RUN npm config set registry http://registry.npm.taobao.org
|
||||
RUN npm install && npm run build
|
||||
|
||||
FROM nginx
|
||||
RUN mkdir /app
|
||||
COPY --from=0 /app/dist /app
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
|
@ -0,0 +1,31 @@
|
|||
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;
|
||||
keepalive_timeout 65;
|
||||
server {
|
||||
listen 3030;
|
||||
server_name localhost;
|
||||
location / {
|
||||
root /app;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue