我正在尝试设置一个包含多个容器的 Web 服务器 - 但从我的反向代理的简单设置开始。
我的 docker-compose.yml如下所示:
version: '3'
services:
reverse-proxy:
container_name: reverse-proxy
hostname: reverse-proxy
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx-config/conf.d:/etc/nginx/conf.d
- ./html:/usr/share/nginx/html
environment:
- NGINX_PORT=80
- ENV=development
Run Code Online (Sandbox Code Playgroud)
具有nginx-config文件夹结构,如:
nginx-config
|- templates
|-default.conf.template
|- sites-available
|- mysite.conf.template
Run Code Online (Sandbox Code Playgroud)
和default.conf.template看起来像:
server {
listen ${NGINX_PORT} default_server;
listen [::]:${NGINX_PORT} default_server;
server_name _;
root /usr/share/nginx/html;
charset UTF-8;
error_page 404 /notfound.html;
location = /notfound.html {
allow all;
}
location / {
return 404;
}
access_log off;
log_not_found off; …Run Code Online (Sandbox Code Playgroud) 我正在尝试更新我使用Restkit 0.1到0.20的现有应用程序,但在设置核心数据堆栈时遇到一些问题,因为它遇到异常.
我的AppDelegate上有以下代码:
/*
Complete Core Data stack initialization
*/
NSError *error = nil;
NSURL *modelURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"AppModel" ofType:@"momd"]];
// NOTE: Due to an iOS 5 bug, the managed object model returned is immutable.
NSManagedObjectModel *managedObjectModel = [[[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL] mutableCopy];
RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel];
[managedObjectStore createPersistentStoreCoordinator];
NSString *storePath = [RKApplicationDataDirectory() stringByAppendingPathComponent:@"TSI.sqlite"];
NSString *seedPath = [[NSBundle mainBundle] pathForResource:@"RKSeedDatabase" ofType:@"sqlite"];
//NSPersistentStore __unused *persistentStore = [managedObjectStore addInMemoryPersistentStore:&error];
NSPersistentStore *persistentStore = [managedObjectStore addSQLitePersistentStoreAtPath:storePath fromSeedDatabaseAtPath:seedPath withConfiguration:nil options:nil error:&error];
NSAssert(persistentStore, …Run Code Online (Sandbox Code Playgroud) core-data ×1
docker ×1
ios ×1
nginx ×1
nginx-config ×1
objective-c ×1
restkit ×1
restkit-0.20 ×1