diff --git a/.drone.yml b/.drone.yml index 5e1ed24..e8540ba 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,14 +8,14 @@ platform: arch: amd64 steps: - - name: frontend install + - name: Frontend install image: node:18.2.0 commands: - node -v - yarn --version - yarn - - name: frontend build + - name: Frontend build image: node:18.2.0 commands: - node -v @@ -23,12 +23,19 @@ steps: - yarn - yarn build - - name: run eslint on project files + - name: Lint project using eslint image: node:18.2.0 commands: - yarn lint 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 image: appleboy/drone-ssh pull: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a58d14a --- /dev/null +++ b/Dockerfile @@ -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"]