Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:

- name: Build and tag Docker image
run: |
docker build --no-cache -t ${{ secrets.DOCKER_HUB_USERNAME }}/kws_fe:latest .
docker build --no-cache \
--build-arg VITE_API_DOMAIN=${{ secrets.VITE_API_DOMAIN }} \
-t ${{ secrets.DOCKER_HUB_USERNAME }}/kws_fe:latest .
docker tag ${{ secrets.DOCKER_HUB_USERNAME }}/kws_fe:latest ${{ secrets.DOCKER_HUB_USERNAME }}/kws_fe:latest

- name: Deploy container locally
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.env
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ WORKDIR /app
COPY package*.json ./
RUN npm install --legacy-peer-deps

# 애플리케이션 코드 복사 및 빌드
# 애플리케이션 코드 복사
COPY . .

# 빌드 시 환경 변수 설정
ARG VITE_API_DOMAIN
ENV VITE_API_DOMAIN=${VITE_API_DOMAIN}

# 애플리케이션 빌드
RUN npm run build

# Step 2: Serve the built app with Nginx
Expand Down
13 changes: 0 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/services/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import axios from "axios";
import Cookies from "js-cookie";

const API_DOMAIN = import.meta.env.VITE_API_DOMAIN;

const axiosClient = axios.create({
baseURL: "http://100.101.247.128:25121/api",
baseURL: `http://${API_DOMAIN}/api`,
headers: {
"Content-Type": "application/json",
},
Expand Down