From 3c3a787ad7dd82fc2977481c430e347b74f640bd Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sat, 20 Jan 2024 19:10:18 -0500 Subject: [PATCH] Add Dockerfile template --- fake_home/.vim/templates/Dockerfile | 18 ++++++++++++++++++ fake_home/.vimrc | 1 + 2 files changed, 19 insertions(+) create mode 100644 fake_home/.vim/templates/Dockerfile diff --git a/fake_home/.vim/templates/Dockerfile b/fake_home/.vim/templates/Dockerfile new file mode 100644 index 0000000..494ffdb --- /dev/null +++ b/fake_home/.vim/templates/Dockerfile @@ -0,0 +1,18 @@ +FROM node:alpine + +RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app +RUN mkdir -p /secrets && chown -R node:node /secrets + +WORKDIR /home/node/app + +COPY package*.json ./ + +USER node + +RUN npm ci + +COPY --chown=node:node . . + +EXPOSE 3001 + +CMD ["npm", "start"] diff --git a/fake_home/.vimrc b/fake_home/.vimrc index e2b05bf..9d5381c 100644 --- a/fake_home/.vimrc +++ b/fake_home/.vimrc @@ -170,6 +170,7 @@ if has ("autocmd") autocmd BufNewFile *.js 0r ~/.vim/templates/skeleton.js autocmd BufNewFile *.json 0r ~/.vim/templates/skeleton.json autocmd BufNewFile Makefile 0r ~/.vim/templates/Makefile + autocmd BufNewFile Dockerfile 0r ~/.vim/templates/Dockerfile augroup END endif