Adjust Dockerfile and pipeline.
This commit is contained in:
@@ -20,8 +20,16 @@ steps:
|
|||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: alpine
|
image: alpine
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
environment:
|
||||||
|
DOCKER_USERNAME:
|
||||||
|
from_secret: DOCKER_USERNAME
|
||||||
|
DOCKER_PASSWORD:
|
||||||
|
from_secret: DOCKER_PASSWORD
|
||||||
commands:
|
commands:
|
||||||
- echo "Deploying new version..."
|
- echo "Deploying new version..."
|
||||||
|
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin registry.binderlab.io
|
||||||
- docker pull registry.binderlab.io/harbormaster:latest
|
- docker pull registry.binderlab.io/harbormaster:latest
|
||||||
- docker stop harbormaster || true
|
- docker stop harbormaster || true
|
||||||
- docker rm harbormaster || true
|
- docker rm harbormaster || true
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN go build -o your-app-name .
|
RUN go build -o harbormaster .
|
||||||
|
|
||||||
# Use a small base image for the final container
|
# Use a small base image for the final container
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
@@ -23,7 +23,7 @@ FROM alpine:latest
|
|||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
|
|
||||||
# Copy the compiled binary from the builder stage
|
# Copy the compiled binary from the builder stage
|
||||||
COPY --from=builder /app/your-app-name .
|
COPY --from=builder /app/harbormaster .
|
||||||
|
|
||||||
# Expose the port the app runs on
|
# Expose the port the app runs on
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|||||||
Reference in New Issue
Block a user