- dev.nix (nodejs_20)
- x.dev.nix.docker.yml
- dev.nix - docker
- dev.nix - nodejs_20
- docker-complse.yml
Last active
October 4, 2024 04:08
-
-
Save wanyutang/ba0b21f3090a068595e7695856a9d91b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To learn more about how to use Nix to configure your environment | |
# see: https://developers.google.com/idx/guides/customize-idx-env | |
{ pkgs, ... }: { | |
# Which nixpkgs channel to use. | |
channel = "stable-23.11"; # or "unstable" | |
# Use https://search.nixos.org/packages to find packages | |
packages = [ | |
# pkgs.go | |
# pkgs.python311 | |
# pkgs.nodejs_20 | |
pkgs.docker | |
]; | |
env = {}; | |
services.docker.enable = true; | |
idx = { | |
extensions = [ | |
"vscodevim.vim" | |
]; | |
# Enable previews | |
previews = { | |
enable = true; | |
previews = { | |
# web = { | |
# command = ["npm" "run" "dev"]; | |
# manager = "web"; | |
# env = { | |
# PORT = "$PORT"; | |
# }; | |
# }; | |
}; | |
}; | |
workspace = { | |
onCreate = { | |
# npm-install = "npm install"; | |
}; | |
onStart = { | |
# watch-backend = "npm run watch-backend"; | |
}; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To learn more about how to use Nix to configure your environment | |
# see: https://developers.google.com/idx/guides/customize-idx-env | |
{ pkgs, ... }: { | |
# Which nixpkgs channel to use. | |
channel = "stable-23.11"; # or "unstable" | |
# Use https://search.nixos.org/packages to find packages | |
packages = [ | |
# pkgs.go | |
# pkgs.python311 | |
pkgs.nodejs_20 | |
]; | |
env = {}; | |
idx = { | |
extensions = [ | |
"vscodevim.vim" | |
]; | |
# Enable previews | |
previews = { | |
enable = true; | |
previews = { | |
web = { | |
command = ["npm" "run" "dev"]; | |
manager = "web"; | |
env = { | |
PORT = "$PORT"; | |
}; | |
}; | |
}; | |
}; | |
workspace = { | |
onCreate = { | |
npm-install = "npm install"; | |
}; | |
onStart = { | |
# watch-backend = "npm run watch-backend"; | |
}; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
app: | |
image: node:18 | |
container_name: node-app | |
working_dir: /usr/src/app | |
volumes: | |
- .:/usr/src/app | |
ports: | |
- "3000:3000" | |
command: sh -c "yarn install && yarn dev" | |
restart: unless-stopped | |
environment: | |
- NODE_ENV=development |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment