Backend docker deploy
This commit is contained in:
parent
a1cb1a30d9
commit
f117e4cb65
1
backend/.gitignore
vendored
1
backend/.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
.stack-work/
|
||||
*~
|
||||
dist-newstyle
|
||||
result
|
||||
|
|
55
backend/converted.nix
Normal file
55
backend/converted.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{ mkDerivation
|
||||
, aeson
|
||||
, base
|
||||
, bytestring
|
||||
, classy-prelude
|
||||
, http-types
|
||||
, lib
|
||||
, lifted-base
|
||||
, mtl
|
||||
, text
|
||||
, uuid
|
||||
, wai
|
||||
, warp
|
||||
, websockets
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "jitsi-rooms";
|
||||
version = "0.1.0.0";
|
||||
src = ./.;
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
libraryHaskellDepends = [
|
||||
aeson
|
||||
base
|
||||
bytestring
|
||||
classy-prelude
|
||||
http-types
|
||||
lifted-base
|
||||
mtl
|
||||
text
|
||||
uuid
|
||||
wai
|
||||
warp
|
||||
websockets
|
||||
];
|
||||
executableHaskellDepends = [
|
||||
aeson
|
||||
base
|
||||
bytestring
|
||||
classy-prelude
|
||||
http-types
|
||||
lifted-base
|
||||
mtl
|
||||
text
|
||||
uuid
|
||||
wai
|
||||
warp
|
||||
websockets
|
||||
];
|
||||
homepage = "https://github.com/githubuser/jitsi-rooms#readme";
|
||||
license = lib.licenses.bsd3;
|
||||
mainProgram = "jitsi-rooms-exe";
|
||||
enableSharedExecutables = false;
|
||||
postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
|
||||
}
|
34
backend/default.nix
Normal file
34
backend/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
let
|
||||
config = {
|
||||
packageOverrides = pkgs: rec {
|
||||
haskellPackages = pkgs.haskellPackages.override {
|
||||
overrides = haskellPackagesNew: haskellPackagesOld: rec {
|
||||
jitsi-rooms =
|
||||
haskellPackagesNew.callPackage ./converted.nix { };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
pkgs = import <nixpkgs> { inherit config; };
|
||||
|
||||
|
||||
in
|
||||
pkgs.dockerTools.buildImage {
|
||||
name = "jitsi-rooms";
|
||||
tag = "latest";
|
||||
copyToRoot = pkgs.buildEnv {
|
||||
name = "image-root";
|
||||
paths = [
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
];
|
||||
pathsToLink = [ "/bin" ];
|
||||
};
|
||||
config = {
|
||||
Cmd = [ "${pkgs.haskellPackages.jitsi-rooms}/bin/jitsi-rooms-exe" ];
|
||||
ExposedPorts = {
|
||||
"9160/tcp" = { };
|
||||
"8081/tcp" = { };
|
||||
};
|
||||
};
|
||||
}
|
5
backend/deploy.sh
Executable file
5
backend/deploy.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
nix-build
|
||||
|
||||
scp ./result ffs:/home/ffsys/jitsi-rooms-docker-image
|
|
@ -91,28 +91,3 @@ executable jitsi-rooms-exe
|
|||
, websockets
|
||||
default-language: Haskell2010
|
||||
|
||||
test-suite jitsi-rooms-test
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Spec.hs
|
||||
other-modules:
|
||||
Paths_jitsi_rooms
|
||||
hs-source-dirs:
|
||||
test
|
||||
default-extensions:
|
||||
NoImplicitPrelude,OverloadedStrings,ImportQualifiedPost
|
||||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
|
||||
build-depends:
|
||||
aeson
|
||||
, base >=4.7 && <5
|
||||
, bytestring
|
||||
, classy-prelude
|
||||
, http-types
|
||||
, jitsi-rooms
|
||||
, lifted-base
|
||||
, mtl
|
||||
, text
|
||||
, uuid
|
||||
, wai
|
||||
, warp
|
||||
, websockets
|
||||
default-language: Haskell2010
|
||||
|
|
Loading…
Reference in a new issue