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:
+12
-1
@@ -42,12 +42,23 @@ steps:
|
|||||||
repo: artifactory.ravanertebat.ir/tm/scraper
|
repo: artifactory.ravanertebat.ir/tm/scraper
|
||||||
registry: artifactory.ravanertebat.ir
|
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:
|
node:
|
||||||
tag: aecde-docker-runner
|
tag: aecde-docker-runner
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
- develop
|
- develop
|
||||||
- feature/ted
|
|
||||||
event:
|
event:
|
||||||
- custom
|
- custom
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user