Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
tour-of-heroes-dart
提交
c71854ec
T
tour-of-heroes-dart
项目概览
OpenDocCN
/
tour-of-heroes-dart
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tour-of-heroes-dart
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c71854ec
编写于
1月 05, 2018
作者:
M
Marcus Smith
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve Angular Dockerfile, factor out configurable k8s values
上级
a8bbaeca
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
73 addition
and
24 deletion
+73
-24
Dockerfile
Dockerfile
+22
-2
default.conf
default.conf
+10
-0
k8s/deployment.yaml
k8s/deployment.yaml
+13
-8
nginx.conf
nginx.conf
+27
-0
web/main.dart
web/main.dart
+1
-14
未找到文件。
Dockerfile
浏览文件 @
c71854ec
FROM
google/dart AS build-env
WORKDIR
/app
ADD
pubspec.* /app/
RUN
pub get
--no-precompile
ADD
. /app/
RUN
pub get
--offline
--no-precompile
RUN
pub build
FROM
nginx
COPY
./build/web /usr/share/nginx/html
COPY
--from=build-env /app/build/web /usr/share/nginx/html
COPY
default.conf /etc/nginx/conf.d/default.conf
COPY
nginx.conf /etc/nginx/nginx.conf
RUN
groupadd
-r
angular
RUN
useradd
-m
-r
-g
angular angular
RUN
touch
/var/run/nginx.pid
&&
\
chown
-R
angular:angular /var/run/nginx.pid
&&
\
chown
-R
angular:angular /var/cache/nginx
USER
angular
EXPOSE
80
\ No newline at end of file
EXPOSE
8080
default.conf
0 → 100644
浏览文件 @
c71854ec
server
{
listen
8080
;
server_name
localhost
;
location
/ {
root
/
usr
/
share
/
nginx
/
html
;
index
index
.
html
;
try_files
$
uri
$
uri
/ /
index
.
html
;
}
}
\ No newline at end of file
k8s/deployment.yaml
浏览文件 @
c71854ec
...
...
@@ -2,10 +2,11 @@ apiVersion: v1
kind
:
Service
metadata
:
name
:
web-service
namespace
:
aqueduct-tutorial
namespace
:
$NAMESPACE
spec
:
selector
:
app
:
aqueduct-tutorial
app
:
$APP_NAME
role
:
Frontend
ports
:
-
port
:
80
targetPort
:
80
...
...
@@ -14,31 +15,35 @@ apiVersion: apps/v1beta1
kind
:
Deployment
metadata
:
name
:
web-deployment
namespace
:
aqueduct-tutorial
namespace
:
$NAMESPACE
spec
:
replicas
:
1
template
:
metadata
:
labels
:
app
:
aqueduct-tutorial
app
:
$APP_NAME
role
:
Frontend
spec
:
containers
:
-
name
:
aqueduct-tutorial
-
name
:
$APP_NAME
imagePullPolicy
:
Always
image
:
$IMAGE_NAME
ports
:
-
containerPort
:
80
securityContext
:
runAsNonRoot
:
true
readOnlyRootFilesystem
:
true
---
apiVersion
:
extensions/v1beta1
kind
:
Ingress
metadata
:
name
:
tutorial-ingress
namespace
:
aqueduct-tutorial
name
:
$INGRESS_NAME
namespace
:
$NAMESPACE
annotations
:
kubernetes.io/ingress.class
:
"
nginx"
spec
:
rules
:
-
host
:
aqueduct-tutorial.stablekernel.io
-
host
:
$HOSTNAME
http
:
paths
:
-
path
:
/
...
...
nginx.conf
0 → 100644
浏览文件 @
c71854ec
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
;
include
/etc/nginx/conf.d/*.conf
;
}
web/main.dart
浏览文件 @
c71854ec
import
'package:angular/angular.dart'
;
import
'package:angular_router/angular_router.dart'
;
import
'package:angular_tour_of_heroes/app_component.dart'
;
import
'package:angular_tour_of_heroes/in_memory_data_service.dart'
;
import
'package:http/http.dart'
;
import
'package:http/browser_client.dart'
;
...
...
@@ -9,21 +8,9 @@ void main() {
bootstrap
(
AppComponent
,
[
ROUTER_PROVIDERS
,
// Remove next line in production
provide
(
LocationStrategy
,
useClass:
HashLocationStrategy
),
//
provide(LocationStrategy, useClass: HashLocationStrategy),
// Using a real back end?
// Import browser_client.dart and change the above to:
provide
(
Client
,
useFactory:
()
=>
new
BrowserClient
(),
deps:
[])
]);
}
/*
import 'package:http/browser_client.dart';
void main() {
bootstrap(AppComponent, [
ROUTER_PROVIDERS,
// Remove next line in production
provide(LocationStrategy, useClass: HashLocationStrategy),
provide(BrowserClient, useFactory: () => new BrowserClient(), deps: [])
]);
}
*/
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录