Task: Add Dockerfile and support DroneCI

This commit is contained in:
Sambo Chea 2021-09-13 17:53:12 +07:00
parent 7b402b0559
commit e3bb729619
4 changed files with 43 additions and 2 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
node_modules/
.git/
.husky/

10
.drone.yml Normal file
View File

@ -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

22
Dockerfile Normal file
View File

@ -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"]

View File

@ -1,5 +1,11 @@
# Express Nodejs App # Express Nodejs App
- Nodejs
- Express
- TypeScript
- Prettier
- ESLint
- Docker
- DroneCI
### Contributors ### Contributors
- Sambo Chea <sombochea@cubetiqs.com> - Sambo Chea <sombochea@cubetiqs.com>