feat:#65 increased OCI image base images versions, slightly optimized Dockerfiles and adjust docker-compose.yml's to make them OCI compliant

This commit is contained in:
Justin Kreller
2025-03-11 22:11:07 +01:00
parent 3e6e53dccf
commit 8745dede72
7 changed files with 24 additions and 28 deletions

View File

@ -46,7 +46,7 @@ services:
- "net" - "net"
rproxy: rproxy:
image: bitnami/nginx:1.25 image: docker.io/bitnami/nginx:1.25
restart: always restart: always
volumes: volumes:
- ./reverseproxy.dev.conf:/opt/bitnami/nginx/conf/nginx.conf - ./reverseproxy.dev.conf:/opt/bitnami/nginx/conf/nginx.conf

View File

@ -45,7 +45,7 @@ services:
- "net" - "net"
rproxy: rproxy:
image: bitnami/nginx:1.25 image: docker.io/bitnami/nginx:1.25
restart: always restart: always
volumes: volumes:
- ./reverseproxy.conf:/opt/bitnami/nginx/conf/nginx.conf - ./reverseproxy.conf:/opt/bitnami/nginx/conf/nginx.conf

View File

@ -43,22 +43,19 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
context: ./frontend context: ./frontend
target: prod target: prod
command: "npm run dev"
# open port 8000 # open port 8000
ports: ports:
- "8000:8000" - "8000:8000"
volumes:
- ./frontend/src:/app/src
rproxy: rproxy:
image: bitnami/nginx:1.25 image: docker.io/bitnami/nginx:1.27
volumes: volumes:
- ./reverseproxy.local.conf:/opt/bitnami/nginx/conf/nginx.conf - ./reverseproxy.local.conf:/opt/bitnami/nginx/conf/nginx.conf
depends_on: depends_on:
- htwkalender-data-manager - htwkalender-data-manager
- htwkalender-frontend - htwkalender-frontend
ports: ports:
- "80:80" - "8080:8080"
volumes: volumes:
pb_data: pb_data:

View File

@ -15,7 +15,7 @@
#along with this program. If not, see <https://www.gnu.org/licenses/>. #along with this program. If not, see <https://www.gnu.org/licenses/>.
# build stage # build stage
FROM node:lts-alpine AS build FROM docker.io/node:lts-alpine AS build
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
@ -24,7 +24,7 @@ COPY / ./
RUN npm run build RUN npm run build
# development stage # development stage
FROM node:lts-alpine AS dev FROM docker.io/node:lts-alpine AS dev
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
@ -33,7 +33,7 @@ COPY . ./
# production stage # production stage
# https://hub.docker.com/r/bitnami/nginx -> always run as non-root user # https://hub.docker.com/r/bitnami/nginx -> always run as non-root user
FROM bitnami/nginx:1.25 AS prod FROM docker.io/bitnami/nginx:1.27 AS prod
# copy build files from build container # copy build files from build container
COPY --from=build /app/dist /app COPY --from=build /app/dist /app

View File

@ -25,8 +25,8 @@ http {
limit_req_zone $ratelimit_key zone=createFeed:10m rate=1r/m; limit_req_zone $ratelimit_key zone=createFeed:10m rate=1r/m;
server { server {
listen 80; listen 8080;
listen [::]:80; listen [::]:8080;
http2 on; http2 on;
location /api/feed { location /api/feed {

View File

@ -15,7 +15,7 @@
#along with this program. If not, see <https://www.gnu.org/licenses/>. #along with this program. If not, see <https://www.gnu.org/licenses/>.
# build stage # build stage
FROM golang:alpine AS build FROM docker.io/golang:alpine AS build
WORKDIR /htwkalender-data-manager WORKDIR /htwkalender-data-manager
@ -29,20 +29,19 @@ COPY common/. ./common
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-data-manager data-manager/main.go RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-data-manager data-manager/main.go
# production stage # production stage
FROM alpine:3.20.1 AS prod FROM docker.io/alpine:3.21 AS prod
WORKDIR /htwkalender-data-manager WORKDIR /htwkalender-data-manager
ARG USER=ical ARG USER=ical
RUN adduser -Ds /bin/sh "$USER" && \ RUN adduser -Ds /bin/sh "$USER" && \
chown "$USER":"$USER" ./ mkdir -p data && \
chown -R "$USER":"$USER" ./
USER $USER
RUN mkdir -p data
# copies executable from build container # copies executable from build container
COPY --chown=$USER:$USER --chmod=644 --from=build /htwkalender-data-manager ./ COPY --chown=$USER:$USER --chmod=744 --from=build /htwkalender-data-manager ./
RUN chmod +x main
USER $USER
# Expose port 8090 to the outside world # Expose port 8090 to the outside world
EXPOSE 8090 EXPOSE 8090

View File

@ -15,7 +15,7 @@
#along with this program. If not, see <https://www.gnu.org/licenses/>. #along with this program. If not, see <https://www.gnu.org/licenses/>.
# build stage # build stage
FROM golang:alpine AS build FROM docker.io/golang:alpine AS build
WORKDIR /htwkalender-ical WORKDIR /htwkalender-ical
@ -29,19 +29,19 @@ COPY common/. ./common
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-ical ical/main.go RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-ical ical/main.go
# production stage # production stage
FROM alpine:latest AS prod FROM docker.io/alpine:3.21 AS prod
WORKDIR /htwkalender-ical WORKDIR /htwkalender-ical
ARG USER=ical ARG USER=ical
RUN adduser -Ds /bin/sh $USER && \ RUN adduser -Ds /bin/sh "$USER" && \
chown $USER:$USER ./ mkdir -p data && \
chown -R "$USER":"$USER" ./
USER $USER
RUN mkdir -p data
# copies executable from build container # copies executable from build container
COPY --chown=$USER:$USER --from=build /htwkalender-ical ./ COPY --chown=$USER:$USER --chmod=744 --from=build /htwkalender-ical ./
USER $USER
# Expose port 8091 to the outside world # Expose port 8091 to the outside world
EXPOSE 8091 EXPOSE 8091