Merge pull request 'Add: drone and docker files' (#27) from drone-and-docker into dev

Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/27
Reviewed-by: Nima Nakhsotin <n.nakhostin@ravanertebat.com>
This commit is contained in:
Nima Nakhsotin
2025-09-09 12:14:49 +03:30
2 changed files with 72 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
################################################################################
# web
################################################################################
kind: pipeline
type: docker
name: (admin Panel) build form and push to artifactory
steps:
- name: tag
image: alpine/git:2.40.1
environment:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
settings:
debug: true
commands:
- APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
- echo "APP Version tags $APP_VERSION"
- echo -n "$APP_VERSION" >> .tags
- name: build panel
image: plugins/docker
settings:
# build_args:
# - BUILD_APP=scraper
username: cicd
password:
from_secret: REGISTRY_PASSWORD
# dockerfile: Dockerfile-drone
repo: artifactory.ravanertebat.ir/tm/admin_panel
registry: artifactory.ravanertebat.ir
node:
tag: aecde-docker-runner
trigger:
branch:
- dev
event:
- custom
+32
View File
@@ -0,0 +1,32 @@
FROM node:20.16.0 AS builder
WORKDIR /app
# RUN apk add --no-cache libc6-compat
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
#---
FROM node:20.16.0 AS runner
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./
EXPOSE 3000
CMD ["npm", "start"]