Add Worker Build Step and Dockerfile for Background Processing

- Introduced a new build step in the Drone CI configuration for the worker service, enabling automated Docker image creation.
- Added a Dockerfile for the worker service, defining the build process and dependencies, ensuring a streamlined deployment for background tasks.
- Enhanced the overall CI/CD pipeline to support the new worker service, improving the project's build and deployment capabilities.
This commit is contained in:
n.nakhostin
2025-10-18 09:07:46 +03:30
parent 69d201479f
commit 10a9081c68
2 changed files with 35 additions and 1 deletions
+12 -1
View File
@@ -42,12 +42,23 @@ steps:
repo: artifactory.ravanertebat.ir/tm/scraper
registry: artifactory.ravanertebat.ir
- name: build worker
image: plugins/docker
settings:
build_args:
- BUILD_APP=worker
username: cicd
password:
from_secret: REGISTRY_PASSWORD
dockerfile: ./cmd/worker/Dockerfile
repo: artifactory.ravanertebat.ir/tm/worker
registry: artifactory.ravanertebat.ir
node:
tag: aecde-docker-runner
trigger:
branch:
- main
- develop
- feature/ted
event:
- custom
+23
View File
@@ -0,0 +1,23 @@
ARG GO_VERSION=1.23
ARG BASH_VERSION=5.0
FROM golang:${GO_VERSION} AS go-builder
WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o worker-build ./cmd/worker/main.go
FROM bash:${BASH_VERSION}
RUN apk --no-cache add busybox-suid curl rsync tzdata tcpdump tree ca-certificates s-nail \
&& ln -s /usr/bin/mail /usr/bin/s-nail
WORKDIR /app
COPY --from=go-builder /app/worker-build .
COPY --from=go-builder /app/cmd/worker/assets ./assets
EXPOSE 80
ENTRYPOINT /app/worker-build