Update docker stuff
This commit is contained in:
parent
ea3d1ec561
commit
39f468cc8a
@ -30,6 +30,31 @@ jobs:
|
|||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-api-dev:$(cat version.txt)
|
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-api-dev:$(cat version.txt)
|
||||||
|
|
||||||
|
build-redirector:
|
||||||
|
runs-on: [runner]
|
||||||
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
|
steps:
|
||||||
|
- name: Clone Repository
|
||||||
|
uses: https://github.com/actions/checkout@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build docker
|
||||||
|
run: |
|
||||||
|
cd api
|
||||||
|
docker build -f dockerfile_redirector -t git.sh-edraft.de/sh-edraft.de/open-redirect-redirector-dev:$(cat ../version.txt) .
|
||||||
|
|
||||||
|
- name: Login to registry git.sh-edraft.de
|
||||||
|
uses: https://github.com/docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: git.sh-edraft.de
|
||||||
|
username: ${{ secrets.CI_USERNAME }}
|
||||||
|
password: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push image
|
||||||
|
run: |
|
||||||
|
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-redirector-dev:$(cat version.txt)
|
||||||
|
|
||||||
build-web:
|
build-web:
|
||||||
runs-on: [runner]
|
runs-on: [runner]
|
||||||
@ -53,7 +78,7 @@ jobs:
|
|||||||
- name: Build docker
|
- name: Build docker
|
||||||
run: |
|
run: |
|
||||||
cd web
|
cd web
|
||||||
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat ../version.txt) .
|
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-web-dev:$(cat ../version.txt) .
|
||||||
|
|
||||||
- name: Login to registry git.sh-edraft.de
|
- name: Login to registry git.sh-edraft.de
|
||||||
uses: https://github.com/docker/login-action@v1
|
uses: https://github.com/docker/login-action@v1
|
||||||
@ -64,4 +89,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat version.txt)
|
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-web-dev:$(cat version.txt)
|
||||||
|
@ -3,6 +3,12 @@ FROM python:3.12.8-alpine
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY ./src/ .
|
COPY ./src/ .
|
||||||
|
|
||||||
|
RUN rm redirector
|
||||||
|
RUN rm redirector.py
|
||||||
|
RUN rm -r static
|
||||||
|
RUN rm -r templates
|
||||||
|
|
||||||
COPY ./requirements.txt .
|
COPY ./requirements.txt .
|
||||||
|
|
||||||
RUN python -m pip install --upgrade pip
|
RUN python -m pip install --upgrade pip
|
||||||
|
20
api/dockerfile_redirector
Normal file
20
api/dockerfile_redirector
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM python:3.12.8-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ./src/core .
|
||||||
|
COPY ./src/data .
|
||||||
|
COPY ./src/redirector.py .
|
||||||
|
COPY ./src/redirector .
|
||||||
|
|
||||||
|
COPY ./requirements.txt .
|
||||||
|
|
||||||
|
RUN python -m pip install --upgrade pip
|
||||||
|
RUN python -m pip install -r requirements.txt
|
||||||
|
|
||||||
|
RUN apk update
|
||||||
|
RUN apk add bash
|
||||||
|
RUN apk add nano
|
||||||
|
|
||||||
|
CMD [ "bash", "/app/redirector"]
|
16
api/src/redirector
Executable file
16
api/src/redirector
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ $1 == "-dev" ]]; then
|
||||||
|
export ENVIRONMENT=development
|
||||||
|
export NAME=Open-redirect-dev
|
||||||
|
elif [[ $1 == "-stage" ]]; then
|
||||||
|
export ENVIRONMENT=staging
|
||||||
|
export NAME=Open-redirect-test
|
||||||
|
elif [[ $1 == "-prod" ]]; then
|
||||||
|
export ENVIRONMENT=production
|
||||||
|
export NAME=Open-redirect
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PYTHONPATH=./:$PYTHONPATH
|
||||||
|
|
||||||
|
python3.12 redirector.py
|
Loading…
Reference in New Issue
Block a user