This commit is contained in:
2
.env.development
Normal file
2
.env.development
Normal file
@ -0,0 +1,2 @@
|
||||
REACT_APP_API_AUTH=http://127.0.0.1:8000
|
||||
REACT_APP_API_BLOG=http://127.0.0.1:8800
|
2
.env.production
Normal file
2
.env.production
Normal file
@ -0,0 +1,2 @@
|
||||
REACT_APP_API_AUTH=https://www.demo.test
|
||||
REACT_APP_API_BLOG=https://www.demo.test
|
14
.github/workflows/build.yaml
vendored
14
.github/workflows/build.yaml
vendored
@ -25,13 +25,6 @@ jobs:
|
||||
with:
|
||||
path: ./version
|
||||
|
||||
# .env.production 생성
|
||||
# URL_PROD
|
||||
- name: Create env_production
|
||||
# run: ${{ URL_KUBE_SVC }} > .env.production
|
||||
run: ${{ URL_PROD }} > .env.production
|
||||
|
||||
|
||||
- name: Install Docker // Docker 설치
|
||||
run: |
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
@ -39,7 +32,8 @@ jobs:
|
||||
if: runner.os == 'Linux'
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v1
|
||||
# uses: https://github.com/docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Registry
|
||||
run: docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PW }} https://harbor.icurfer.com
|
||||
@ -59,7 +53,7 @@ jobs:
|
||||
- name: Checkout kustomize repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "icurfer/cd-msa-fe"
|
||||
repository: "dev/cd-msa-fe"
|
||||
ref: main
|
||||
token: ${{ secrets.ACTION_TOKEN }}
|
||||
path: cd-msa-fe
|
||||
@ -67,7 +61,7 @@ jobs:
|
||||
- name: Update Kubernetes resources
|
||||
run: |
|
||||
cd cd-msa-fe/overlays/dev/
|
||||
kustomize edit set image \harbor.icurfer.com/msa-demo/msa-fe:\${{ steps.img-ver.outputs.content }}
|
||||
kustomize edit set image harbor.icurfer.com/msa-demo/msa-fe:${{ steps.img-ver.outputs.content }}
|
||||
cat kustomization.yaml
|
||||
|
||||
## cd commit
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,10 +15,10 @@
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.development
|
||||
# .env.development
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.production
|
||||
# .env.production
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
|
@ -1,10 +1,6 @@
|
||||
# Build stage
|
||||
FROM node:20.11 as builder
|
||||
|
||||
# Build arguments for React environment variables
|
||||
ARG REACT_APP_API_AUTH
|
||||
ARG REACT_APP_API_BLOG
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
@ -17,10 +13,6 @@ RUN npm install
|
||||
# Copy the rest of the application
|
||||
COPY . ./
|
||||
|
||||
# Set env vars for React build (only works if passed as build-arg)
|
||||
ENV REACT_APP_API_AUTH=$REACT_APP_API_AUTH
|
||||
ENV REACT_APP_API_BLOG=$REACT_APP_API_BLOG
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
|
42
Dockerfile_test
Normal file
42
Dockerfile_test
Normal file
@ -0,0 +1,42 @@
|
||||
# Build stage
|
||||
FROM node:20.11 as builder
|
||||
|
||||
# Build arguments for React environment variables
|
||||
ARG REACT_APP_API_AUTH
|
||||
ARG REACT_APP_API_BLOG
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy package.json and package-lock.json (if available)
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application
|
||||
COPY . ./
|
||||
|
||||
# Set env vars for React build (only works if passed as build-arg)
|
||||
ENV REACT_APP_API_AUTH=$REACT_APP_API_AUTH
|
||||
ENV REACT_APP_API_BLOG=$REACT_APP_API_BLOG
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy the build output to Nginx html directory
|
||||
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
|
||||
|
||||
# Copy Nginx configuration file
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Start Nginx server
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
# docker build -t harbor.icurfer.com/msa-demo/msa-fe:kong-0 --build-arg REACT_APP_API_AUTH=https://www.demo.test --build-arg
|
Reference in New Issue
Block a user