diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a049062da27560192d90b0cb864161673c90757a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM node:alpine +COPY . . +RUN npm install +EXPOSE 3000 +CMD ["node", "index.js"] diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..1abd92c8fc28f1efd5286676f4bf4c9b2228a634 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,10 @@ +#!/bin/bash +image_name='automatic-clock-in' +df_name='Dockerfile' +port=13000 +# build image if not exists +if [ `sudo docker images | grep ${image_name} | wc -l` -lt 1 ]; then + sudo docker build -f ${PWD}/${df_name} -t ${image_name} . +fi +# run container base on the image +sudo docker run -d --name ${image_name} -p ${port}:3000 ${image_name}