[release] v0.6.4-unstable

This commit is contained in:
Yann Stepienik 2023-06-07 17:40:17 +01:00
parent 2fdcd9ee70
commit c28a5c51e2
2 changed files with 23 additions and 15 deletions

View file

@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.6.3",
"version": "0.6.4-unstable",
"description": "",
"main": "test-server.js",
"bugs": {

View file

@ -40,28 +40,36 @@ func NewDB(w http.ResponseWriter, req *http.Request) (string, error) {
imageName = "mongo:4.4"
}
err := RunContainer(
imageName,
monHost,
[]string{
service := DockerServiceCreateRequest{
Services: map[string]ContainerCreateRequestContainer {},
}
service.Services[monHost] = ContainerCreateRequestContainer{
Name: monHost,
Image: imageName,
RestartPolicy: "always",
Environment: []string{
"MONGO_INITDB_ROOT_USERNAME=" + mongoUser,
"MONGO_INITDB_ROOT_PASSWORD=" + mongoPass,
},
[]VolumeMount{
Labels: map[string]string{
"cosmos-force-network-secured": "true",
},
Volumes: []mount.Mount{
{
Destination: "/data/db",
Volume: &types.Volume{
Name: "cosmos-mongo-data-" + id,
},
Type: mount.TypeVolume,
Source: "cosmos-mongo-data-" + id,
Target: "/data/db",
},
{
Destination: "/data/configdb",
Volume: &types.Volume{
Name: "cosmos-mongo-config-" + id,
},
Type: mount.TypeVolume,
Source: "cosmos-mongo-config-" + id,
Target: "/data/configdb",
},
},
)
};
err := CreateService(w, req, service)
if err != nil {
return "", err