在我的docker-compose(3.7)文件中,我有类似
- ./a/src/:/var/www/html/
- ./a/config/local.php.ini:/usr/local/etc/php/conf.d/local.ini
Run Code Online (Sandbox Code Playgroud)
例如可以在此示例中找到。
每当我在./a/src目录中的主机或其中的容器中更改某些内容时,/var/www/html/它都会按预期在另一侧更改。它们与应有的相同。
该文件不是这样。它被复制(我猜)到容器中。但是,如果我local.php.ini在主机上更改,或者/usr/local/etc/php/conf.d/local.ini其他主机保持不变。
这是预期的行为吗?如果是,为什么并且可以更改它,两个文件都与目录相同
注意:这与如何在卷中装载单个文件不是重复的。我的文件不是目录等文件。尽管如此,我还是尝试使用绝对目录,并按照建议进行了尝试,但这并没有改变。${PWD}
Docker version 19.03.1, build 74b1e89
docker-compose version 1.24.1, build 4667896b
Run Code Online (Sandbox Code Playgroud)
主机和容器系统是Debian。
我有一个获取 BehaviourSubjects 的角度 (9) 组件。我从许多这样的来源学习到在显示可观察内容时使用async-pipe (而不是在 ngInit 中订阅它)。还有一个技巧,使用*ngIf*withas可以避免一直重复。但既然它们毕竟是行为主体,我可以简单地做
<div>{{behaviourSubject.getValue()}}</div>
Run Code Online (Sandbox Code Playgroud)
管他呢。实际上,对我来说,使用“异步”似乎更干净,并且实际上会导致更少的问题。但我不确定这是一个好的模式还是有严重的缺点?
我真的不知所措,遇到这个问题,我真的希望有人能帮助我。我正在使用 Postgresql 9.3。我的数据库主要包含德语文本,但不仅如此,所以它以 utf-8 编码。我想建立一个支持德语的全文搜索,到目前为止没有什么特别的。但是搜索的行为真的很奇怪,我无法找出我做错了什么。
因此,以下表为例
select * from test;
a
-------------
ein Baum
viele Bäume
Überleben
Tisch
Tische
Café
\d test
Tabelle »public.test«
Spalte | Typ | Attribute
--------+------+-----------
a | text |
sintext=# \d
Liste der Relationen
Schema | Name | Typ | Eigentümer
--------+---------------------+---------+------------
(...)
public | test | Tabelle | paf
Run Code Online (Sandbox Code Playgroud)
现在,让我们看一些文本搜索示例:
select * from test where to_tsvector('german', a) @@ plainto_tsquery('Baum');
a
-------------
ein Baum
viele Bäume
select * from test where to_tsvector('german', a) @@ plainto_tsquery('Bäume'); …Run Code Online (Sandbox Code Playgroud) 在我的pom.xml我有
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20170516</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我的程序需要并使用这个版本的 JSON。
import org.json.JSONObject;
Run Code Online (Sandbox Code Playgroud)
当我放入
final JsonObject jsonObject = new JsonObject();
System.out.println( jsonObject.getClass().getPackage().getImplementationVersion());
Run Code Online (Sandbox Code Playgroud)
我得到
20170516
Run Code Online (Sandbox Code Playgroud)
好的,好的。(注意:这是程序的一个类,不是测试!)
现在我使用mvn test. 我收到一个错误,它与 JSONObject 版本有关。日志说:
0.0.20131108.vaadin1
Run Code Online (Sandbox Code Playgroud)
我发现,这个版本来自这个依赖
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.0</version>
<scope>test</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
如果我删除它,我的测试工作正常。
但是现在其他测试失败了,它使用了这种依赖
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
Run Code Online (Sandbox Code Playgroud)
并在 pom.xml 中
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.4.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
如何配置maven,程序使用JSON版本20170516,但是spring-test仍然可以使用jsonassert?
即使几乎是同名,我也不认为这是 Maven 中 *两个版本的依赖项的重复
-- 编辑 1
mvn dependency:tree | grep json
[INFO] +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] +- com.jayway.jsonpath:json-path-assert:jar:2.2.0:test …Run Code Online (Sandbox Code Playgroud) 我根据 DREDD 的规范测试我的 Api(考虑到Dredd 支持的痛苦限制,用 Openapi3 编写)。不,我有一个端点,如果 Accept-header 设置为如此,它会生成 CSV 数据。
'/my-endpoint':
summary: ...
description: ...
get:
# parameters:
# -
# in: header
# name: Accept
# description: "Response format: application/json or text/csv"
# example: "text/csv"
responses:
'200':
description: ...
content:
text/csv:
schema:
type: string
example:
summary: 'csv table'
value: 'cell1, cell2'
Run Code Online (Sandbox Code Playgroud)
当我使用 Dredd 运行测试时,测试失败并显示
expected:
headers:
body:
[
{
"key": "summary",
"value": "csv table"
},
{
"key": "value",
"value": "cell1, cell2"
}
]
statusCode: 200
Run Code Online (Sandbox Code Playgroud)
显然存在一些误解,Dredd …
angular ×1
containers ×1
diacritics ×1
docker ×1
dredd ×1
java ×1
javascript ×1
maven ×1
openapi ×1
postgresql ×1
rxjs ×1
utf-8 ×1