deployment_files
This commit is contained in:
+1
-1
@@ -23,5 +23,5 @@ class ApiConstants {
|
|||||||
static const getSystemParameters = '$baseUrl/sysparam/getSysParams';
|
static const getSystemParameters = '$baseUrl/sysparam/getSysParams';
|
||||||
static const updateSystemParams = '$baseUrl/sysparam/updateSysParams';
|
static const updateSystemParams = '$baseUrl/sysparam/updateSysParams';
|
||||||
|
|
||||||
static const baseUrl ='http://157.66.191.31:46232/back';
|
static const baseUrl ='http://157.66.191.31:46239/back';
|
||||||
}
|
}
|
||||||
+7
-205
@@ -1,205 +1,7 @@
|
|||||||
########################################
|
# TEST-REPLACE
|
||||||
# Global build arguments (must be re-declared
|
FROM alpine/git:v2.30.1 AS code
|
||||||
# in every stage that needs them)
|
ARG BUILD_ID
|
||||||
########################################
|
ARG GITEA_USER=risadmin_prod
|
||||||
ARG GITEA_USER
|
ARG GITEA_PASS=adminprod1234
|
||||||
ARG GITEA_PASS
|
RUN git clone http://risadmin_prod:adminprod1234@157.66.191.31:3000/risadmin_prod/mytest16sep01.git
|
||||||
ARG GITEA_URL=157.66.191.31:3000
|
RUN echo DOMAIN=157.66.191.31:3000 REPO=mytest16sep01 TO=mytest16sep01 MSG="deployment_files"
|
||||||
ARG GITEA_ORG
|
|
||||||
ARG REPO_NAME
|
|
||||||
ARG GIT_BRANCH=main
|
|
||||||
|
|
||||||
ARG JAR_NAME=app-1.0.0.jar
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Stage 1 - Clone Repository + Auto-discover modules
|
|
||||||
########################################
|
|
||||||
|
|
||||||
FROM alpine/git:latest AS source
|
|
||||||
|
|
||||||
ARG GITEA_USER
|
|
||||||
ARG GITEA_PASS
|
|
||||||
ARG GITEA_URL
|
|
||||||
ARG GITEA_ORG
|
|
||||||
ARG REPO_NAME
|
|
||||||
ARG GIT_BRANCH
|
|
||||||
|
|
||||||
WORKDIR /src
|
|
||||||
|
|
||||||
RUN git clone --branch ${GIT_BRANCH} --single-branch \
|
|
||||||
http://${GITEA_USER}:${GITEA_PASS}@${GITEA_URL}/${GITEA_ORG}/${REPO_NAME}.git
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Auto-discover backend (*-b), frontend (*-f), and
|
|
||||||
# db (*-d) top-level folders, regardless of the service
|
|
||||||
########################################
|
|
||||||
|
|
||||||
RUN set -e; \
|
|
||||||
BACKEND_DIR=$(find /src/${REPO_NAME} -maxdepth 1 -type d -name "*-b" | head -n1); \
|
|
||||||
FRONTEND_DIR=$(find /src/${REPO_NAME} -maxdepth 1 -type d -name "*-f" | head -n1); \
|
|
||||||
DB_DIR=$(find /src/${REPO_NAME} -maxdepth 1 -type d -name "*-d" | head -n1); \
|
|
||||||
if [ -z "$BACKEND_DIR" ]; then \
|
|
||||||
echo "ERROR: No backend module folder (ending in -b) found under /src/${REPO_NAME}"; \
|
|
||||||
ls -la /src/${REPO_NAME}; \
|
|
||||||
exit 1; \
|
|
||||||
fi; \
|
|
||||||
if [ -z "$FRONTEND_DIR" ]; then \
|
|
||||||
echo "ERROR: No frontend module folder (ending in -f) found under /src/${REPO_NAME}"; \
|
|
||||||
ls -la /src/${REPO_NAME}; \
|
|
||||||
exit 1; \
|
|
||||||
fi; \
|
|
||||||
if [ -z "$DB_DIR" ]; then \
|
|
||||||
echo "WARNING: No db module folder (ending in -d) found under /src/${REPO_NAME}"; \
|
|
||||||
fi; \
|
|
||||||
echo "Backend module found : $BACKEND_DIR"; \
|
|
||||||
echo "Frontend module found : $FRONTEND_DIR"; \
|
|
||||||
echo "DB module found : $DB_DIR"; \
|
|
||||||
ln -s "$BACKEND_DIR" /src/backend-module; \
|
|
||||||
ln -s "$FRONTEND_DIR" /src/frontend-module; \
|
|
||||||
if [ -n "$DB_DIR" ]; then ln -s "$DB_DIR" /src/db-module; fi
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Stage 2 - Backend Build
|
|
||||||
########################################
|
|
||||||
|
|
||||||
FROM maven:3.9.3-eclipse-temurin-8 AS backend-build
|
|
||||||
|
|
||||||
WORKDIR /workspace/backend
|
|
||||||
|
|
||||||
COPY --from=source \
|
|
||||||
/src/backend-module/authsec_springboot/backend/ \
|
|
||||||
./
|
|
||||||
|
|
||||||
RUN mvn clean package -DskipTests
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Stage 3 - Frontend Build
|
|
||||||
########################################
|
|
||||||
|
|
||||||
FROM node:16.20.2 AS frontend-build
|
|
||||||
|
|
||||||
WORKDIR /workspace/frontend
|
|
||||||
|
|
||||||
COPY --from=source \
|
|
||||||
/src/frontend-module/authsec_angular/frontend/angular-clarity-master/ \
|
|
||||||
./
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS=--max_old_space_size=4096
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Stage 4 - Runtime
|
|
||||||
########################################
|
|
||||||
|
|
||||||
FROM ubuntu:22.04
|
|
||||||
|
|
||||||
ARG REPO_NAME
|
|
||||||
ARG JAR_NAME
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y \
|
|
||||||
openjdk-17-jre \
|
|
||||||
mysql-server \
|
|
||||||
nginx \
|
|
||||||
supervisor \
|
|
||||||
curl \
|
|
||||||
wget \
|
|
||||||
git \
|
|
||||||
nano \
|
|
||||||
net-tools \
|
|
||||||
procps \
|
|
||||||
ca-certificates && \
|
|
||||||
rm -f /etc/nginx/conf.d/default.conf && \
|
|
||||||
apt-get clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Create Directories
|
|
||||||
########################################
|
|
||||||
|
|
||||||
RUN mkdir -p \
|
|
||||||
/opt/backend \
|
|
||||||
/opt/database \
|
|
||||||
/opt/frontend \
|
|
||||||
/var/log/supervisor
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Backend
|
|
||||||
########################################
|
|
||||||
|
|
||||||
COPY --from=backend-build \
|
|
||||||
/workspace/backend/target/${JAR_NAME} \
|
|
||||||
/opt/backend/app.jar
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# SQL Files
|
|
||||||
########################################
|
|
||||||
|
|
||||||
COPY --from=source \
|
|
||||||
/src/backend-module/authsec_springboot/backend/src/main/resources/schema.sql \
|
|
||||||
/opt/database/schema.sql
|
|
||||||
|
|
||||||
COPY --from=source \
|
|
||||||
/src/backend-module/authsec_springboot/backend/src/main/resources/data.sql \
|
|
||||||
/opt/database/data.sql
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Frontend
|
|
||||||
########################################
|
|
||||||
|
|
||||||
COPY --from=frontend-build /workspace/frontend/dist/ /usr/share/nginx/html/
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Configuration Files
|
|
||||||
########################################
|
|
||||||
|
|
||||||
COPY --from=source \
|
|
||||||
/src/${REPO_NAME}/sureops/entrypoint.sh \
|
|
||||||
/usr/local/bin/entrypoint.sh
|
|
||||||
|
|
||||||
COPY --from=source \
|
|
||||||
/src/${REPO_NAME}/sureops/init-db.sh \
|
|
||||||
/usr/local/bin/init-db.sh
|
|
||||||
|
|
||||||
COPY --from=source \
|
|
||||||
/src/${REPO_NAME}/sureops/supervisord.conf \
|
|
||||||
/etc/supervisor/conf.d/supervisord.conf
|
|
||||||
|
|
||||||
COPY --from=source \
|
|
||||||
/src/${REPO_NAME}/sureops/nginx.conf \
|
|
||||||
/etc/nginx/nginx.conf
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Permissions
|
|
||||||
########################################
|
|
||||||
|
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh && \
|
|
||||||
chmod +x /usr/local/bin/init-db.sh
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Ports
|
|
||||||
########################################
|
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
EXPOSE 9292
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# Start
|
|
||||||
########################################
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
|
||||||
+1
-1
@@ -58,7 +58,7 @@ DOCKER_TAG=1.0
|
|||||||
# Build Path
|
# Build Path
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
PATH_DIR="/data/66086_1789618194255/sureops"
|
PATH_DIR="/data/66086_1789619806112/sureops"
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# Image Names
|
# Image Names
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ DOMAIN=157.66.191.31:3000
|
|||||||
#WEB-URL-PORT
|
#WEB-URL-PORT
|
||||||
CONT_PORT=3306
|
CONT_PORT=3306
|
||||||
TARGET_PORT=9292
|
TARGET_PORT=9292
|
||||||
PATH_DIR=/data/66086_1789618194255/sureops/mytest16sep01-back-b/deployment
|
PATH_DIR=/data/66086_1789619806112/sureops/mytest16sep01-back-b/deployment
|
||||||
#**********************
|
#**********************
|
||||||
cd $PATH_DIR
|
cd $PATH_DIR
|
||||||
DOCKER_TAG=1.0
|
DOCKER_TAG=1.0
|
||||||
|
|||||||
Reference in New Issue
Block a user