mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
feat(nvim-docker-compose): Snippets for sample full-stack app
This commit is contained in:
@@ -8,6 +8,12 @@
|
|||||||
],
|
],
|
||||||
"path": "./dockerfile.json"
|
"path": "./dockerfile.json"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"language": [
|
||||||
|
"yaml"
|
||||||
|
],
|
||||||
|
"path": "./yaml.json"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"language": [
|
"language": [
|
||||||
"rust"
|
"rust"
|
||||||
|
|||||||
99
common/.config/nvim/custom-snippets/yaml.json
Normal file
99
common/.config/nvim/custom-snippets/yaml.json
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
{
|
||||||
|
"Web Full Stack Docker Compose": {
|
||||||
|
"prefix": "web-full-stack-docker-compose",
|
||||||
|
"description": "Template for web full-stack docker-compose",
|
||||||
|
"body": [
|
||||||
|
"---",
|
||||||
|
"name: ${1:application-name}",
|
||||||
|
"services:",
|
||||||
|
" db:",
|
||||||
|
" image: ${2:postgres:latest}",
|
||||||
|
" networks:",
|
||||||
|
" - db-net",
|
||||||
|
" ports:",
|
||||||
|
" - ${3:5432}:${3}",
|
||||||
|
" volumes:",
|
||||||
|
" - pgdata:/var/lib/postgresql/data",
|
||||||
|
" environment:",
|
||||||
|
" - POSTGRES_PASSWORD=${4:postgres-login-password}",
|
||||||
|
" restart: unless-stopped",
|
||||||
|
" init: true",
|
||||||
|
" security_opt:",
|
||||||
|
" - no-new-privileges",
|
||||||
|
"",
|
||||||
|
" api:",
|
||||||
|
" image: ${5:backend-api-image}",
|
||||||
|
" build:",
|
||||||
|
" context: ${6:backend-api-code-directory}",
|
||||||
|
" dockerfile: ${7:backend-api-dockerfile}",
|
||||||
|
" networks:",
|
||||||
|
" - db-net",
|
||||||
|
" - public-net",
|
||||||
|
" depends_on:",
|
||||||
|
" - db",
|
||||||
|
" ports:",
|
||||||
|
" - ${8:8080}:${8}",
|
||||||
|
" environment:",
|
||||||
|
" - DATABASE_URL=postgres://postgres:${4}@db:${3}/postgres",
|
||||||
|
" restart: unless-stopped",
|
||||||
|
" init: true",
|
||||||
|
" security_opt:",
|
||||||
|
" - no-new-privileges",
|
||||||
|
" cap_drop:",
|
||||||
|
" - ALL",
|
||||||
|
" cap_add:",
|
||||||
|
" - CHOWN",
|
||||||
|
" - NET_BIND_SERVICE",
|
||||||
|
"",
|
||||||
|
" frontend-vite:",
|
||||||
|
" image: ${9:frontend-dev-image}",
|
||||||
|
" build:",
|
||||||
|
" context: ${10:frontend-code-directory}",
|
||||||
|
" dockerfile: ${11:frontend-dev-dockerfile}",
|
||||||
|
" networks:",
|
||||||
|
" - public-net",
|
||||||
|
" depends_on:",
|
||||||
|
" - api",
|
||||||
|
" ports:",
|
||||||
|
" - ${12:5173}:${12}",
|
||||||
|
" volumes:",
|
||||||
|
" - ${10}vite.config.js:/usr/src/app/vite.config.js:ro",
|
||||||
|
" init: true",
|
||||||
|
" security_opt:",
|
||||||
|
" - no-new-privileges",
|
||||||
|
" cap_drop:",
|
||||||
|
" - ALL",
|
||||||
|
" cap_add:",
|
||||||
|
" - CHOWN",
|
||||||
|
" - NET_BIND_SERVICE",
|
||||||
|
"",
|
||||||
|
" frontend-nginx:",
|
||||||
|
" image: ${13:frontend-nginx-image}",
|
||||||
|
" build:",
|
||||||
|
" context: ${10}",
|
||||||
|
" dockerfile: ${14:frontend-nginx-dockerfile}",
|
||||||
|
" networks:",
|
||||||
|
" - public-net",
|
||||||
|
" depends_on:",
|
||||||
|
" - api",
|
||||||
|
" ports:",
|
||||||
|
" - ${15:2000}:8080",
|
||||||
|
" restart: unless-stopped",
|
||||||
|
" init: true",
|
||||||
|
" security_opt:",
|
||||||
|
" - no-new-privileges",
|
||||||
|
" cap_drop:",
|
||||||
|
" - ALL",
|
||||||
|
" cap_add:",
|
||||||
|
" - CHOWN",
|
||||||
|
" - NET_BIND_SERVICE",
|
||||||
|
"",
|
||||||
|
"networks:",
|
||||||
|
" db-net:",
|
||||||
|
" public-net:",
|
||||||
|
"",
|
||||||
|
"volumes:",
|
||||||
|
" pgdata:"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user