Skip to content

Commit 454dffa

Browse files
committed
chore: 환경변수 설정
1 parent d082529 commit 454dffa

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,9 @@ jobs:
2828
script: |
2929
sudo docker rm -f $(docker ps -aqf "name=^${{secrets.DOCKERHUB_REPO}}") # 컨테이너 찾아서 종료
3030
sudo docker pull ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKERHUB_REPO}}:latest
31-
sudo docker run -d -p 80:80 --name ${{secrets.DOCKERHUB_REPO}} ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKERHUB_REPO}}:latest
31+
sudo docker run \
32+
-e VITE_API_URL=${{ secrets.VITE_API_URL }} \
33+
-d -p 80:80 \
34+
--name ${{secrets.DOCKERHUB_REPO}} \
35+
${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKERHUB_REPO}}:latest
3236
sudo docker image prune -f

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ RUN rm /etc/nginx/conf.d/default.conf
2525
# nginx 템플릿 복사
2626
COPY nginx.conf.template /etc/nginx/templates/
2727

28-
# 환경변수 설정
29-
ENV BACKEND_URL=http://localhost:8080
30-
3128
# 빌드된 정적 파일 복사
3229
COPY --from=builder /app/build /usr/share/nginx/html
3330

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig({
88
open: true,
99
proxy: {
1010
'/api': {
11-
target: 'http://localhost:8080',
11+
target: process.env.VITE_API_URL || 'http://localhost:8080',
1212
changeOrigin: true,
1313
rewrite: (path) => path.replace(/^\/api/, '')
1414
}

0 commit comments

Comments
 (0)