Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
O
Oyun Parkı API
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Nyx
Oyun Parkı API
Commits
c51a6ee1
Kaydet (Commit)
c51a6ee1
authored
May 04, 2021
tarafından
Hakkı Dizdar
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Koyteynerleri durdurma fonksiyonu eklendi
üst
ebff9bfa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
create.js
docker/controllers/create.js
+1
-1
index.js
index.js
+14
-2
No files found.
docker/controllers/create.js
Dosyayı görüntüle @
c51a6ee1
...
...
@@ -10,7 +10,7 @@ const start = async (image, res) => {
AttachStdout
:
true
,
AttachStderr
:
true
,
HostConfig
:
{
AutoRemove
:
true
,
//
AutoRemove: true,
ShmSize
:
2000000000
,
PortBindings
:
{
"5900/tcp"
:
[
...
...
index.js
Dosyayı görüntüle @
c51a6ee1
...
...
@@ -2,7 +2,7 @@ const express = require("express");
const
compression
=
require
(
"compression"
);
const
app
=
express
();
const
Docker
=
require
(
"dockerode"
);
const
docker
1
=
new
Docker
();
const
docker
=
new
Docker
();
const
ws
=
require
(
"express-ws"
)(
app
);
app
.
use
(
compression
());
...
...
@@ -13,7 +13,7 @@ app.get("/", (_, res) => {
});
app
.
get
(
"/images"
,
(
_
,
res
)
=>
{
docker
1
.
listImages
(
function
(
_
,
images
)
{
docker
.
listImages
(
function
(
_
,
images
)
{
res
.
send
(
images
.
filter
(
(
i
)
=>
...
...
@@ -32,6 +32,18 @@ app.post("/restart", (req, res) => {
res
.
send
(
docker
.
getContainer
(
req
.
body
.
container
).
restart
());
});
app
.
post
(
"/stop"
,
(
req
,
res
)
=>
{
const
container
=
docker
.
getContainer
(
req
.
body
.
container
);
container
.
stop
()
.
then
(()
=>
{
res
.
status
(
200
).
end
();
})
.
catch
(()
=>
{
res
.
status
(
500
).
end
();
});
});
require
(
"./socket"
)(
app
);
app
.
listen
(
3000
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment