Compare commits

...

4 Commits

Author SHA1 Message Date
4d939a1460 테스트
All checks were successful
Build and Push / Build Docker image (push) Successful in 44s
2025-03-22 04:04:38 +09:00
581e40cb7d 요청을 받으면 콘솔에 출력하도록 수정
All checks were successful
Build and Push / Build Docker image (push) Successful in 43s
2025-03-22 02:33:31 +09:00
73dcb6b5e3 컨테이너 배포 스크립트 작성
All checks were successful
Build and Push / Build Docker image (push) Successful in 3m58s
2025-03-22 02:09:43 +09:00
c9789631ba 도커파일 추가 2025-03-22 01:55:02 +09:00
3 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
name: Build and Push
run-name: ${{ gitea.actor }} running
on:
push:
branches:
- main
jobs:
build:
name: Build Docker image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set env
run: |
echo "CONTAINER_REGISTRY=$(echo ${{ gitea.server_url }} | sed -e 's|^[^:]*://||')" >> $GITEA_ENV
- name: Build
run: docker build -t ${{ env.CONTAINER_REGISTRY }}/${{ gitea.repository }}:latest .
- name: Login
run: docker login -u ${{ secrets.REGISTRY_ID }} -p ${{ secrets.REGISTRY_PASS }} ${{ env.CONTAINER_REGISTRY }}
- name: Push
run: docker push ${{ env.CONTAINER_REGISTRY }}/${{ gitea.repository }}

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM rust:latest
# ARG RWT_ENV_VAR_0_DEFAULT='This is default env variable 0'
# ARG RWT_ENV_VAR_1_DEFAULT='This is default env variable 1'
# ARG RWT_ENV_VAR_2_DEFAULT='This is default env variable 2'
# ENV RWT_ENV_VAR_0=${RWT_ENV_VAR_0_DEFAULT}
# ENV RWT_ENV_VAR_1=${RWT_ENV_VAR_1_DEFAULT}
# ENV RWT_ENV_VAR_2=${RWT_ENV_VAR_2_DEFAULT}
WORKDIR /usr/src/app
COPY . .
RUN cargo install --path .
EXPOSE 3000
CMD ["rust-simple-web-api"]

View File

@@ -47,8 +47,8 @@ pub fn router() -> Router {
} }
async fn root() -> axum::response::Html<String> { async fn root() -> axum::response::Html<String> {
let current_time = Local::now().format("%Y-%m-%d %H:%M:%S !!!").to_string();
let current_time = Local::now().format("%Y-%m-%d %H:%M:%S").to_string(); println!("Current Time: {}", current_time);
axum::response::Html(format!("<h1>Current Time: {}</h1>", current_time)) axum::response::Html(format!("<h1>Current Time: {}</h1>", current_time))
} }