chore: integrate both web frontends to the Docker stuff

This commit is contained in:
Emmanuel BENOîT 2025-01-03 16:14:25 +01:00
parent 389304ed4d
commit 523b98f8a3
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg
4 changed files with 44 additions and 2 deletions

View file

@ -20,3 +20,25 @@ COPY --from=build /src/legacyworlds-server/legacyworlds-server-main/target/lib /
ADD docker/backend-entrypoint.sh /app/entrypoint.sh ADD docker/backend-entrypoint.sh /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"] ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["server"] CMD ["server"]
FROM tomcat:6.0-jre7 AS tomcat-base
RUN <<EOF
rm -rf /usr/local/tomcat/webapps/*
adduser --system --no-create-home \
--ingroup www-data \
--shell /bin/false \
--home $CATALINA_HOME \
tomcat
chown -R tomcat: /usr/local/tomcat
EOF
USER tomcat
FROM tomcat-base AS lwmain
COPY --from=build \
/src/legacyworlds-web/legacyworlds-web-main/target/*.war \
$CATALINA_HOME/webapps/ROOT.war
FROM tomcat-base AS lwadmin
COPY --from=build \
/src/legacyworlds-web/legacyworlds-web-main/target/*.war \
$CATALINA_HOME/webapps/ROOT.war

View file

@ -17,6 +17,24 @@ services:
secrets: secrets:
- lw_db_password - lw_db_password
web-main:
build:
context: ..
dockerfile: docker/Dockerfile.application
target: lwmain
restart: always
environment:
LW_BACKEND_HOST: backend
web-admin:
build:
context: ..
dockerfile: docker/Dockerfile.application
target: lwadmin
restart: always
environment:
LW_BACKEND_HOST: backend
secrets: secrets:
lw_db_password: lw_db_password:
environment: LW_DB_PASSWORD environment: LW_DB_PASSWORD

View file

@ -7,6 +7,7 @@
<context:annotation-config /> <context:annotation-config />
<context:component-scan base-package="com.deepclone.lw.web.admin" /> <context:component-scan base-package="com.deepclone.lw.web.admin" />
<context:property-placeholder />
<!-- FreeMarker templating library --> <!-- FreeMarker templating library -->
<bean id="freemarkerConfig" <bean id="freemarkerConfig"
@ -29,7 +30,7 @@
<bean id="sessionSrv" class="org.springframework.remoting.rmi.RmiProxyFactoryBean" <bean id="sessionSrv" class="org.springframework.remoting.rmi.RmiProxyFactoryBean"
scope="prototype"> scope="prototype">
<property name="serviceInterface" value="com.deepclone.lw.session.SessionAccessor" /> <property name="serviceInterface" value="com.deepclone.lw.session.SessionAccessor" />
<property name="serviceUrl" value="rmi://localhost:9137/sessionSrv" /> <property name="serviceUrl" value="rmi://${LW_BACKEND_HOST}:9137/sessionSrv" />
</bean> </bean>
<!-- General web beans --> <!-- General web beans -->

View file

@ -7,6 +7,7 @@
<context:annotation-config /> <context:annotation-config />
<context:component-scan base-package="com.deepclone.lw.web.main" /> <context:component-scan base-package="com.deepclone.lw.web.main" />
<context:property-placeholder />
<!-- FreeMarker templating library --> <!-- FreeMarker templating library -->
<bean id="freemarkerConfig" <bean id="freemarkerConfig"
@ -29,7 +30,7 @@
<bean id="sessionSrv" class="org.springframework.remoting.rmi.RmiProxyFactoryBean" <bean id="sessionSrv" class="org.springframework.remoting.rmi.RmiProxyFactoryBean"
scope="prototype"> scope="prototype">
<property name="serviceInterface" value="com.deepclone.lw.session.SessionAccessor" /> <property name="serviceInterface" value="com.deepclone.lw.session.SessionAccessor" />
<property name="serviceUrl" value="rmi://localhost:9137/sessionSrv" /> <property name="serviceUrl" value="rmi://${LW_BACKEND_HOST}:9137/sessionSrv" />
</bean> </bean>
<!-- General web beans --> <!-- General web beans -->