Docker fixes (#1)
Reviewed-on: phoenix/textsender-api#1
This commit was merged in pull request #1.
This commit is contained in:
@@ -36,6 +36,8 @@ jobs:
|
|||||||
cat > ~/.gitconfig << "EOF"
|
cat > ~/.gitconfig << "EOF"
|
||||||
[url "ssh://git@${{ secrets.GIT_HOST_ROOT }}"]
|
[url "ssh://git@${{ secrets.GIT_HOST_ROOT }}"]
|
||||||
insteadOf = https://${{ secrets.GIT_HOST_ROOT }}
|
insteadOf = https://${{ secrets.GIT_HOST_ROOT }}
|
||||||
|
[url "ssh://git@${{ secrets.GIT_HOST_ROOT }}"]
|
||||||
|
insteadOf = http://${{ secrets.GIT_HOST_ROOT }}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Building binary"
|
echo "Building binary"
|
||||||
@@ -49,7 +51,7 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:18.3-alpine
|
image: postgres:18.4-alpine
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: ${{ secrets.DB_TEST_USER }}
|
POSTGRES_USER: ${{ secrets.DB_TEST_USER }}
|
||||||
POSTGRES_PASSWORD: ${{ secrets.DB_TEST_PASSWORD }}
|
POSTGRES_PASSWORD: ${{ secrets.DB_TEST_PASSWORD }}
|
||||||
@@ -125,6 +127,8 @@ jobs:
|
|||||||
cat > ~/.gitconfig << "EOF"
|
cat > ~/.gitconfig << "EOF"
|
||||||
[url "ssh://git@${{ secrets.GIT_HOST_ROOT }}"]
|
[url "ssh://git@${{ secrets.GIT_HOST_ROOT }}"]
|
||||||
insteadOf = https://${{ secrets.GIT_HOST_ROOT }}
|
insteadOf = https://${{ secrets.GIT_HOST_ROOT }}
|
||||||
|
[url "ssh://git@${{ secrets.GIT_HOST_ROOT }}"]
|
||||||
|
insteadOf = http://${{ secrets.GIT_HOST_ROOT }}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
go test -v ./...
|
go test -v ./...
|
||||||
|
|||||||
+3
-2
@@ -11,7 +11,8 @@ RUN mkdir -p -m 0700 ~/.ssh && \
|
|||||||
ssh-keyscan git.kundeng.us >> ~/.ssh/known_hosts
|
ssh-keyscan git.kundeng.us >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
# Configure Git to use SSH for GitHub
|
# Configure Git to use SSH for GitHub
|
||||||
RUN git config --global url."ssh://git@git.kundeng.us".insteadOf "https://git.kundeng.us"
|
RUN git config --global url."git@git.kundeng.us:".insteadOf "https://git.kundeng.us/" && \
|
||||||
|
git config --global url."git@git.kundeng.us:".insteadOf "http://git.kundeng.us/"
|
||||||
|
|
||||||
# Set up the Go environment for private modules
|
# Set up the Go environment for private modules
|
||||||
ENV GOPRIVATE=git.kundeng.us
|
ENV GOPRIVATE=git.kundeng.us
|
||||||
@@ -20,7 +21,7 @@ ENV GOPRIVATE=git.kundeng.us
|
|||||||
# Copy go mod and sum files
|
# Copy go mod and sum files
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
|
|
||||||
RUN --mount=type=ssh mkdir src && \
|
RUN --mount=type=ssh \
|
||||||
go mod download
|
go mod download
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
|
|||||||
+4
-4
@@ -53,7 +53,7 @@ services:
|
|||||||
|
|
||||||
# PostgreSQL Database Service
|
# PostgreSQL Database Service
|
||||||
main_db:
|
main_db:
|
||||||
image: postgres:18.3-alpine # Use an official Postgres image (Alpine variant is smaller)
|
image: postgres:18.4-alpine # Use an official Postgres image (Alpine variant is smaller)
|
||||||
container_name: textsender_db # Optional: Give the container a specific name
|
container_name: textsender_db # Optional: Give the container a specific name
|
||||||
environment:
|
environment:
|
||||||
# These MUST match the user, password, and database name in the DATABASE_URL above
|
# These MUST match the user, password, and database name in the DATABASE_URL above
|
||||||
@@ -62,7 +62,7 @@ services:
|
|||||||
POSTGRES_DB: ${POSTGRES_AUTH_DB:-textsender_db}
|
POSTGRES_DB: ${POSTGRES_AUTH_DB:-textsender_db}
|
||||||
volumes:
|
volumes:
|
||||||
# Persist database data using a named volume
|
# Persist database data using a named volume
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@@ -77,7 +77,7 @@ services:
|
|||||||
restart: always # Optional: Restart policy
|
restart: always # Optional: Restart policy
|
||||||
|
|
||||||
auth_db:
|
auth_db:
|
||||||
image: postgres:18.3-alpine # Use an official Postgres image (Alpine variant is smaller)
|
image: postgres:18.4-alpine # Use an official Postgres image (Alpine variant is smaller)
|
||||||
container_name: textsender_auth_db # Optional: Give the container a specific name
|
container_name: textsender_auth_db # Optional: Give the container a specific name
|
||||||
environment:
|
environment:
|
||||||
# These MUST match the user, password, and database name in the DATABASE_URL above
|
# These MUST match the user, password, and database name in the DATABASE_URL above
|
||||||
@@ -86,7 +86,7 @@ services:
|
|||||||
POSTGRES_DB: ${POSTGRES_AUTH_DB:-textsender_auth_db}
|
POSTGRES_DB: ${POSTGRES_AUTH_DB:-textsender_auth_db}
|
||||||
volumes:
|
volumes:
|
||||||
# Persist database data using a named volume
|
# Persist database data using a named volume
|
||||||
- postgres_data_auth:/var/lib/postgresql/data
|
- postgres_data_auth:/var/lib/postgresql
|
||||||
ports:
|
ports:
|
||||||
- "5433:5432"
|
- "5433:5432"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|||||||
Reference in New Issue
Block a user