mirror of
https://github.com/JustKato/drive-health.git
synced 2026-03-04 08:29:45 +02:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2c84fb6b2 | |||
| 4f50819f92 | |||
| 6117157598 | |||
| 79e44bd88a | |||
| c556e3827b |
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
|
||||||
|
!main.go
|
||||||
|
!/lib
|
||||||
|
!/templates
|
||||||
|
!/go.mod
|
||||||
|
!/go.sum
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
FROM debian:bullseye
|
FROM debian:bullseye
|
||||||
ENV IS_DOCKER TRUE
|
ENV IS_DOCKER TRUE
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.source https://github.com/JustKato/drive-health
|
||||||
|
|
||||||
# Install build dependencies and runtime dependencies
|
# Install build dependencies and runtime dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
gcc \
|
gcc \
|
||||||
@@ -25,7 +27,7 @@ ENV GO111MODULE=on
|
|||||||
ENV DIST_DIR=/app
|
ENV DIST_DIR=/app
|
||||||
|
|
||||||
# Create the directory and set it as the working directory
|
# Create the directory and set it as the working directory
|
||||||
WORKDIR $DIST_DIR
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy the Go files and download dependencies
|
# Copy the Go files and download dependencies
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
|
|||||||
11
deploy.sh
11
deploy.sh
@@ -29,7 +29,8 @@ echo_color green "All tests passed successfully."
|
|||||||
|
|
||||||
echo_color green "Starting the Docker build process with version $GIT_VERSION..."
|
echo_color green "Starting the Docker build process with version $GIT_VERSION..."
|
||||||
|
|
||||||
IMAGE_NAME="ghcr.io/JustKato/drive-health:$GIT_VERSION"
|
LATEST_IMAGE_NAME="ghcr.io/justkato/drive-health:latest"
|
||||||
|
IMAGE_NAME="ghcr.io/justkato/drive-health:$GIT_VERSION"
|
||||||
echo_color yellow "Image to be built: $IMAGE_NAME"
|
echo_color yellow "Image to be built: $IMAGE_NAME"
|
||||||
|
|
||||||
# Confirmation to build
|
# Confirmation to build
|
||||||
@@ -38,6 +39,10 @@ if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
|||||||
# Building the Docker image
|
# Building the Docker image
|
||||||
echo "Building Docker image: $IMAGE_NAME"
|
echo "Building Docker image: $IMAGE_NAME"
|
||||||
docker build --no-cache -t $IMAGE_NAME .
|
docker build --no-cache -t $IMAGE_NAME .
|
||||||
|
|
||||||
|
# Also tag this build as 'latest'
|
||||||
|
echo "Tagging image as latest: $LATEST_IMAGE_NAME"
|
||||||
|
docker tag $IMAGE_NAME $LATEST_IMAGE_NAME
|
||||||
else
|
else
|
||||||
echo_color red "Build cancelled."
|
echo_color red "Build cancelled."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -49,6 +54,10 @@ if [[ "$push_response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
|||||||
# Pushing the image
|
# Pushing the image
|
||||||
echo "Pushing image: $IMAGE_NAME"
|
echo "Pushing image: $IMAGE_NAME"
|
||||||
docker push $IMAGE_NAME
|
docker push $IMAGE_NAME
|
||||||
|
|
||||||
|
# Pushing the 'latest' image
|
||||||
|
echo "Pushing latest image: $LATEST_IMAGE_NAME"
|
||||||
|
docker push $LATEST_IMAGE_NAME
|
||||||
else
|
else
|
||||||
echo_color red "Push cancelled."
|
echo_color red "Push cancelled."
|
||||||
fi
|
fi
|
||||||
|
|||||||
17
docker-compose.prod.yml
Normal file
17
docker-compose.prod.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
drive-health:
|
||||||
|
# Latest image pull, mention the specific version here please.
|
||||||
|
image: ghcr.io/justkato/drive-health:latest
|
||||||
|
# Restart in case of crashing
|
||||||
|
restart: unless-stopped
|
||||||
|
# Load environment variables from .env file
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
# Mount the volume to the local drive
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
# Setup application ports
|
||||||
|
ports:
|
||||||
|
- 5003:8080
|
||||||
Reference in New Issue
Block a user