Commit a5f556ee authored by Boris Mühmer's avatar Boris Mühmer
Browse files

basic setup

parent 3c5b05c5
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+71 −0
Original line number Diff line number Diff line
# === GitLab CI/CD Pipeline for httpinformer ===

stages:
  - debug
  - build

Debug Build Environment:
  stage: debug
  image: quay.io/buildah/stable:latest
  script:
    - env | sort | nl || true
  except:
    - main
    - master
    # development-*

Build Golang Development Docker Image:
  stage: build
  image: quay.io/buildah/stable:latest
  before_script:
    - buildah login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
  script:
    - cd golang
    - >
      buildah bud -f Dockerfile
      --build-arg DOCKER_VERSION_NAME="${CI_COMMIT_BRANCH}"
      --tag "${CI_REGISTRY_IMAGE}/golang:${CI_BUILD_REF_NAME}"
      .
    - buildah push $CI_REGISTRY_IMAGE/golang:$CI_BUILD_REF_NAME
  except:
    - main
    - master
    - development-*

Build TypeScript Development Docker Image:
  stage: build
  image: quay.io/buildah/stable:latest
  before_script:
    - buildah login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
  script:
    - cd typescript
    - >
      buildah bud -f Dockerfile
      --build-arg DOCKER_VERSION_NAME="${CI_COMMIT_BRANCH}"
      --tag "${CI_REGISTRY_IMAGE}/typescript:${CI_BUILD_REF_NAME}"
      .
    - buildah push $CI_REGISTRY_IMAGE/typescript:$CI_BUILD_REF_NAME
  except:
    - main
    - master
    - development-*

Build Angular Development Docker Image:
  stage: build
  image: quay.io/buildah/stable:latest
  before_script:
    - buildah login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
  script:
    - cd angular
    - >
      buildah bud -f Dockerfile
      --build-arg DOCKER_VERSION_NAME="${CI_COMMIT_BRANCH}"
      --tag "${CI_REGISTRY_IMAGE}/angular:${CI_BUILD_REF_NAME}"
      .
    - buildah push $CI_REGISTRY_IMAGE/angular:$CI_BUILD_REF_NAME
  except:
    - main
    - master
    - development-*

# === End Of File ===

angular/Dockerfile

0 → 100644
+35 −0
Original line number Diff line number Diff line

ARG DEBIAN_NAME="bullseye"
ARG NODE_VERSION="16"
#ARG NODE_VERSION="18"

FROM docker.io/node:${NODE_VERSION}-${DEBIAN_NAME}

ARG USER_NAME="coder"
ARG USER_COMMENT="Code Developer"
ARG USER_ID="1337"
ARG USER_SHELL="/bin/bash"
ARG GROUP_NAME="${USER_NAME}"
ARG GROUP_ID="${USER_ID}"

RUN apt update \
    && apt update \
    && apt upgrade -y \
    && apt install -y tree \
    && apt autoremove -y \
    && apt autoclean -y \
    && apt clean \
    && npm install --location=global npm \
    && npm install --location=global typescript \
    && npm install --location=global @angular/cli \
    && npm update  --location=global \
    && groupadd -g ${GROUP_ID} ${GROUP_NAME} \
    && useradd  -u ${USER_ID} -g ${GROUP_NAME} -c "${USER_COMMENT}" -m -s ${USER_SHELL} ${USER_NAME} \
    && echo "Done."

EXPOSE 4200/tcp
EXPOSE 9876/tcp

#USER node
USER coder
CMD ["/bin/bash"]

golang/Dockerfile

0 → 100644
+29 −0
Original line number Diff line number Diff line

ARG DEBIAN_NAME="bullseye"
ARG GO_VERSION="1.19"

FROM docker.io/golang:${GO_VERSION}-${DEBIAN_NAME}

ARG USER_NAME="coder"
ARG USER_COMMENT="Code Developer"
ARG USER_ID="1337"
ARG USER_SHELL="/bin/bash"
ARG GROUP_NAME="${USER_NAME}"
ARG GROUP_ID="${USER_ID}"

RUN export DEBIAN_FRONTEND=noninteractive \
    && apt update \
    && apt update \
    && apt upgrade -y \
    && apt install -y tree \
    && apt autoremove -y \
    && apt autoclean -y \
    && apt clean \
    && groupadd -g ${GROUP_ID} ${GROUP_NAME} \
    && useradd  -u ${USER_ID} -g ${GROUP_NAME} -c "${USER_COMMENT}" -m -s ${USER_SHELL} ${USER_NAME} \
    && echo "Done."

EXPOSE 8000/tcp

USER coder
CMD ["/bin/bash"]

typescript/Dockerfile

0 → 100644
+34 −0
Original line number Diff line number Diff line

ARG DEBIAN_NAME="bullseye"
ARG NODE_VERSION="16"
#ARG NODE_VERSION="18"

FROM docker.io/node:${NODE_VERSION}-${DEBIAN_NAME}

ARG USER_NAME="coder"
ARG USER_COMMENT="Code Developer"
ARG USER_ID="1337"
ARG USER_SHELL="/bin/bash"
ARG GROUP_NAME="${USER_NAME}"
ARG GROUP_ID="${USER_ID}"

RUN apt update \
    && apt update \
    && apt upgrade -y \
    && apt install -y tree \
    && apt autoremove -y \
    && apt autoclean -y \
    && apt clean \
    && npm install --location=global npm \
    && npm install --location=global typescript \
    && npm update  --location=global \
    && groupadd -g ${GROUP_ID} ${GROUP_NAME} \
    && useradd  -u ${USER_ID} -g ${GROUP_NAME} -c "${USER_COMMENT}" -m -s ${USER_SHELL} ${USER_NAME} \
    && echo "Done."

EXPOSE 4200/tcp
EXPOSE 9876/tcp

#USER node
USER coder
CMD ["/bin/bash"]