Skip to content

Commit cc0e190

Browse files
committed
Update fix file, google
1 parent 4fa3614 commit cc0e190

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Sandbox Image - Build on Server
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- "docker/sandbox.Dockerfile"
8+
- ".github/workflows/sandbox-image-build-on-server.yml"
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build-on-server:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Prepare bundle
21+
run: |
22+
mkdir -p deploy_sandbox
23+
# Đổi tên để build context đơn giản trên server
24+
cp docker/sandbox.Dockerfile deploy_sandbox/Dockerfile
25+
26+
- name: Upload Dockerfile to server
27+
uses: appleboy/[email protected]
28+
with:
29+
host: ${{ secrets.SSH_HOST }}
30+
username: ${{ secrets.SSH_USER }}
31+
key: ${{ secrets.SSH_PRIVATE_KEY }}
32+
port: ${{ secrets.SSH_PORT }}
33+
source: "deploy_sandbox/Dockerfile"
34+
target: "/opt/codecampus/sandbox"
35+
overwrite: true
36+
37+
- name: Build image on server
38+
uses: appleboy/[email protected]
39+
env:
40+
IMAGE_NAME: capstoneprojectpythondocker
41+
with:
42+
host: ${{ secrets.SSH_HOST }}
43+
username: ${{ secrets.SSH_USER }}
44+
key: ${{ secrets.SSH_PRIVATE_KEY }}
45+
port: ${{ secrets.SSH_PORT }}
46+
envs: IMAGE_NAME
47+
script_stop: true
48+
script: |
49+
set -euo pipefail
50+
mkdir -p /opt/codecampus/sandbox
51+
cd /opt/codecampus/sandbox
52+
53+
dateTag="$(date +%Y%m%d.%H%M%S)"
54+
echo "Building ${IMAGE_NAME}:${dateTag} and ${IMAGE_NAME}:latest ..."
55+
docker build -f Dockerfile -t "${IMAGE_NAME}:${dateTag}" -t "${IMAGE_NAME}:latest" .
56+
57+
echo "Prune dangling images…"
58+
docker image prune -f || true
59+
60+
docker images | grep "${IMAGE_NAME}" || true
61+
echo "✅ Build done."

docker-compose.prod-services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ services:
188188
- MongoDbSettings__DatabaseName=${FILE_DATABASE}
189189
- AppSettings__ApiSettings__UserServiceBaseUrl=http://profile-service:8081
190190
- AppSettings__MinioConfig__Endpoint=minio
191-
- AppSettings__MinioConfig__PublicEndpoint=localhost
191+
- AppSettings__MinioConfig__PublicEndpoint=codecampus.site
192192
- AppSettings__MinioConfig__Port=9000
193193
- AppSettings__MinioConfig__AccessKey=${MINIO_ROOT_USER}
194194
- AppSettings__MinioConfig__SecretKey=${MINIO_ROOT_PASSWORD}

identity-service/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ app:
6464
google:
6565
client-id: "839020123858-qnan968uvj0u9d5h6bq5cd5ulls9h7dk.apps.googleusercontent.com"
6666
client-secret: "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"
67-
redirect-uri: "http://localhost:4200/auth/identity/authenticate"
67+
redirect-uri: "https://codecampus.site/auth/identity/authenticate"
6868
event:
6969
user-events: "user-events"
7070
user-registrations: "user-registrations"

0 commit comments

Comments
 (0)