Skip to content

Commit a013613

Browse files
committed
Use Docker volumes and nodemon in development
1 parent c238ff6 commit a013613

5 files changed

Lines changed: 712 additions & 34 deletions

File tree

Dockerfile.withset

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This "FROM" image is previously emitted by nix
22
FROM ghcr.io/engineer-man/piston:base-latest
33

4-
ENV PISTON_FLAKE_PATH=/piston/packages
5-
COPY runtimes/ /piston/packages/runtimes
6-
COPY flake.nix flake.lock /piston/packages/
4+
ENV PISTON_FLAKE_PATH=/piston/src
5+
COPY runtimes/ /piston/src/runtimes
6+
COPY flake.nix flake.lock /piston/src/
77

88

99
ARG RUNTIMESET=all

api/default.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ with pkgs; rec {
4242
gnugrep
4343
rename
4444
util-linux
45+
nodejs-16_x
46+
yarn
47+
python3
48+
gcc
49+
gnumake
50+
gnused
4551
];
4652

4753
extraCommands = ''
@@ -53,6 +59,9 @@ with pkgs; rec {
5359
echo "nixbld$i:x:$(( $i + 30000 )):30000:Nix build user $i:/var/empty:/run/current-system/sw/bin/nologin" >> etc/passwd
5460
done
5561
62+
mkdir -p usr/bin
63+
ln -s /bin/env usr/bin/env
64+
chmod -R 1777 usr
5665
chmod 1777 {,var/}tmp/
5766
'';
5867

@@ -86,4 +95,4 @@ with pkgs; rec {
8695
};
8796
};
8897
};
89-
}
98+
}

api/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@
88
"express": "^4.17.1",
99
"express-ws": "^5.0.2",
1010
"logplease": "^1.2.15",
11+
"nocamel": "git://github.com/HexF/nocamel.git#patch-1",
1112
"node-fetch": "^2.6.1",
1213
"uuid": "^8.3.2",
13-
"nocamel": "git://github.com/HexF/nocamel.git#patch-1",
1414
"waitpid": "git://github.com/HexF/node-waitpid.git"
1515
},
1616
"license": "MIT",
1717
"scripts": {
18+
"dev": "nodemon .",
1819
"lint": "prettier . --write",
1920
"prepack": "yarn2nix > yarn.nix"
2021
},
2122
"devDependencies": {
2223
"node2nix": "^1.6.0",
24+
"nodemon": "^2.0.15",
2325
"prettier": "2.2.1"
2426
},
2527
"bin": {

0 commit comments

Comments
 (0)