Add Docker build and Drone frontend deployment
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Mihir Motiyani 2026-10-04 12:12:46 +05:30
parent c19a9763a9
commit b60bd3c0b9
3 changed files with 50 additions and 0 deletions

6
.dockerignore Normal file
View File

@ -0,0 +1,6 @@
.git
node_modules
dist
.env
.env.*
*.log

35
.drone.yml Normal file
View File

@ -0,0 +1,35 @@
kind: pipeline
type: docker
name: Deploy frontend
trigger:
branch:
- main
event:
- push
steps:
- name: Build and push image
image: plugins/docker
settings:
registry: git.midastix.com
repo: git.midastix.com/ci-docker-repo-user/mani-agro-frontend
tags:
- latest
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: Deploy website
image: appleboy/drone-ssh
settings:
host: maniagroexports.midastix.com
port: 22
username: mani-agro-frontend
fingerprint: SHA256:z2qkspOCs67OZnm7jfrQRskZAyFSivzWiuZnxbsrhgo
key:
from_secret: server_ssh_pkey
command_timeout: 5m
script:
- sudo -n /opt/deployable/mani-agro-frontend/docker/deploy.sh

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM node:24-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM alpine:3.22
COPY --from=build /app/dist /app/dist