From e3bb729619b1a5a209a1913c6904c82320c807d7 Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Mon, 13 Sep 2021 17:53:12 +0700 Subject: [PATCH] Task: Add Dockerfile and support DroneCI --- .dockerignore | 3 +++ .drone.yml | 10 ++++++++++ Dockerfile | 22 ++++++++++++++++++++++ README.md | 10 ++++++++-- 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e615e94 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules/ +.git/ +.husky/ \ No newline at end of file diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0dbd19c --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +kind: pipeline +type: docker +name: ci +steps: + - name: build + image: d.ctdn.net/node + commands: + - npm config set registry https://r.ctdn.net + - npm install + - npm run build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c29cf25 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM cubetiq/calpine-node:latest +LABEL maintainer="sombochea@cubetiqs.com" + +RUN echo "Starting setting up timezone to ${TIMEZ}..." +ENV TIMEZ=Asia/Phnom_Penh +# For Alpine +# Setup Timezone +RUN apk update && \ + apk add --no-cache tzdata && \ + cp /usr/share/zoneinfo/${TIMEZ} /etc/localtime && \ + echo ${TIMEZ} > /etc/timezone + +WORKDIR /app +COPY . /app + +RUN npm config set registry https://r.ctdn.net +RUN npm config get registry +RUN npm install +RUN npm run build + +EXPOSE 3000 +CMD [ "npm" , "serve"] \ No newline at end of file diff --git a/README.md b/README.md index a6ff834..f2a344e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Express Nodejs App +- Nodejs +- Express +- TypeScript +- Prettier +- ESLint +- Docker +- DroneCI ### Contributors -- Sambo Chea - +- Sambo Chea \ No newline at end of file