Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker ui builds #2662

Merged
merged 4 commits into from
Jun 4, 2024
Merged
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ task assembleBackend() {
description 'Assemble all Backend-Bundles'

subprojects.each { proj ->
if( proj.name ==~ /io.openems.(backend|common|shared|wrapper).*/ ) {
if( proj.name ==~ /io.openems.(backend|common|oem|shared|wrapper).*/ ) {
if (proj.tasks.findAll { it.name == 'assemble' }) {
dependsOn(proj.assemble)
}
Expand Down
5 changes: 2 additions & 3 deletions tools/docker/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ ARG JAVA_VERSION=21
FROM --platform=$BUILDPLATFORM eclipse-temurin:${JAVA_VERSION}-alpine AS build_backend

WORKDIR /src
ENV OEMS_BACKEND_OUTPUT=/opt/openems-backend.jar
RUN --mount=type=bind,target=.,readwrite \
--mount=type=cache,target=/root/.gradle \
./gradlew --no-build-cache assemble && \
./gradlew --no-build-cache buildBackend && \
cp build/openems-backend.jar /opt
./gradlew --no-build-cache buildBackend

### Build jar container base
FROM ghcr.io/linuxserver/baseimage-alpine:edge AS base_container
Expand Down
5 changes: 2 additions & 3 deletions tools/docker/edge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ ARG JAVA_VERSION=21
FROM --platform=$BUILDPLATFORM eclipse-temurin:${JAVA_VERSION}-alpine AS build_edge

WORKDIR /src
ENV OEMS_EDGE_OUTPUT=/opt/openems-edge.jar
RUN --mount=type=bind,target=.,readwrite \
--mount=type=cache,target=/root/.gradle \
./gradlew --no-build-cache assemble && \
./gradlew --no-build-cache buildEdge && \
cp build/openems-edge.jar /opt/
./gradlew --no-build-cache buildEdge

### Build jar container base
FROM ghcr.io/linuxserver/baseimage-alpine:edge AS base_container
Expand Down
12 changes: 6 additions & 6 deletions tools/docker/ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ FROM --platform=$BUILDPLATFORM node:${NODE}-alpine AS build_ui

ARG VERSION

RUN apk update && apk upgrade;
RUN apk add --update --no-cache patch

COPY ui/ /src/
COPY tools/docker/ui/index.patch /src/

WORKDIR /src

RUN npm install && \
RUN patch src/index.html < index.patch && \
npm install && \
node_modules/.bin/ng build -c "$VERSION";

### Build ui base
FROM ghcr.io/linuxserver/baseimage-alpine:edge AS ui_base

RUN apk update && apk upgrade

RUN apk add --no-cache \
RUN apk add --update --no-cache \
nginx openssl

### Build ui container
Expand All @@ -37,4 +37,4 @@ VOLUME /var/log/nginx

ENV UI_WEBSOCKET ws://localhost:8080

EXPOSE 80 443
EXPOSE 80 443
3 changes: 3 additions & 0 deletions tools/docker/ui/index.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@@ -12,1 +12,1 @@
- <!-- anchor for docker configurations -->
+ <script src="assets/env.js"></script>
3 changes: 1 addition & 2 deletions ui/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no" />

<!-- Load environment variables, if available. Needed for Dockerimages -->
<!-- <script src="assets/env.js" onerror="null"></script> -->
<!-- anchor for docker configurations -->

<!-- Workaround -> has to be removed, icons should be already included in materials -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
Expand Down