Project dockerfile & added build as ci step
This commit is contained in:
13
.drone.yml
13
.drone.yml
@@ -8,14 +8,14 @@ platform:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: frontend install
|
- name: Frontend install
|
||||||
image: node:18.2.0
|
image: node:18.2.0
|
||||||
commands:
|
commands:
|
||||||
- node -v
|
- node -v
|
||||||
- yarn --version
|
- yarn --version
|
||||||
- yarn
|
- yarn
|
||||||
|
|
||||||
- name: frontend build
|
- name: Frontend build
|
||||||
image: node:18.2.0
|
image: node:18.2.0
|
||||||
commands:
|
commands:
|
||||||
- node -v
|
- node -v
|
||||||
@@ -23,12 +23,19 @@ steps:
|
|||||||
- yarn
|
- yarn
|
||||||
- yarn build
|
- yarn build
|
||||||
|
|
||||||
- name: run eslint on project files
|
- name: Lint project using eslint
|
||||||
image: node:18.2.0
|
image: node:18.2.0
|
||||||
commands:
|
commands:
|
||||||
- yarn lint
|
- yarn lint
|
||||||
failure: ignore
|
failure: ignore
|
||||||
|
|
||||||
|
- name: Build and tag docker image
|
||||||
|
image: node:18.2.0
|
||||||
|
commands:
|
||||||
|
- docker build -t seasoned .
|
||||||
|
- docker tag seasoned kevinmidboe/seasoned
|
||||||
|
failure: ignore
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
pull: true
|
pull: true
|
||||||
|
|||||||
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
FROM node:18-alpine3.15
|
||||||
|
|
||||||
|
RUN apk update && apk add curl
|
||||||
|
|
||||||
|
RUN mkdir -p /opt/seasoned/node_modules
|
||||||
|
WORKDIR /opt/seasoned
|
||||||
|
|
||||||
|
COPY src /opt/seasoned/src
|
||||||
|
COPY public /opt/seasoned/public
|
||||||
|
COPY yarn.lock /opt/seasoned
|
||||||
|
COPY package.json /opt/seasoned
|
||||||
|
COPY server.ts /opt/seasoned
|
||||||
|
COPY webpack.config.js /opt/seasoned
|
||||||
|
COPY tsconfig**.json /opt/seasoned
|
||||||
|
|
||||||
|
RUN chown -R node:node /opt/seasoned
|
||||||
|
|
||||||
|
USER node
|
||||||
|
|
||||||
|
RUN yarn install
|
||||||
|
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
EXPOSE 5001
|
||||||
|
|
||||||
|
CMD ["yarn", "start"]
|
||||||
Reference in New Issue
Block a user