Drone setup init
continuous-integration/drone Build is passing Details

This commit is contained in:
Mihir Motiyani 2025-09-30 14:04:57 +05:30
parent b7fe35d9ed
commit 86a1e167b1
3 changed files with 77 additions and 0 deletions

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
node_modules
.git
.gitignore
README.md
.env
.DS_Store
*.log

41
.drone.yml Normal file
View File

@ -0,0 +1,41 @@
kind: pipeline
type: docker
name: Build Image
steps:
- name: Build Docker Image
image: plugins/docker
settings:
build_args:
- API_BASE_URL=https://www.skylinebulletin.in/
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: git.midastix.com/ci-docker-repo-user/skylinebulletin
registry: git.midastix.com
when:
branch:
- main
event:
- push
- name: Deploy image
image: appleboy/drone-ssh
settings:
host: skylinebulletin.in
username: skylinebulletin
key:
from_secret: server_ssh_pkey
port: 22
command_timeout: 3m
script:
- echo "Deploying image"
- sudo /opt/deployable/skylinebulletin/docker/deploy.sh
- echo "Completed Deployment"
when:
branch:
- main
event:
- push

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
# Stage 1: Build
FROM node:20-bullseye AS builder
WORKDIR /app
# Copy package files and install dependencies
COPY package.json package-lock.json ./
RUN npm install
# Copy the rest of the source code
COPY . .
# Set environment variable for Vite
ENV VITE_API_BASE_URL=https://midastix.com/api
# Fix permissions for all node_modules binaries and build
RUN chmod -R +x node_modules/.bin/ && \
npm run build
# Stage 2: Serve with Node
FROM node:20-bullseye
WORKDIR /app
RUN npm install -g serve
# Copy build output from builder
COPY --from=builder /app/dist build
EXPOSE 3000
CMD ["serve", "-s", ".", "-l", "3000"]