add workflow for building containers
This commit is contained in:
parent
99152733ce
commit
2b27d79736
34
.gitea/workflows/build-container-backend.yaml
Normal file
34
.gitea/workflows/build-container-backend.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
name: build-container-backend
|
||||
|
||||
on:
|
||||
workflow-dispatch:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build-x86_64:
|
||||
runs-on: hardware-x86_64
|
||||
steps:
|
||||
- name: Pull repository
|
||||
run: |
|
||||
git init
|
||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/sdlc-project
|
||||
git fetch
|
||||
git checkout master
|
||||
- name: Build docker image
|
||||
run: docker build backend/ -f backend/Dockerfile-x86_64 -t 10.5.1.5:5000/hasslesstech/sdlc-container
|
||||
- name: Push docker image to registry
|
||||
run: docker push 10.5.1.5:5000/hasslesstech/sdlc-container
|
||||
|
||||
build-armv7:
|
||||
runs-on: hardware-armv7
|
||||
steps:
|
||||
- name: Pull repository
|
||||
run: |
|
||||
git init
|
||||
git remote add gitea http://10.1.1.1:3000/hasslesstech/sdlc-project
|
||||
git fetch
|
||||
git checkout master
|
||||
- name: Build docker image
|
||||
run: docker build backend/ -f backend/Dockerfile-armv7 -t 10.5.1.5:5000/hasslesstech/sdlc-container
|
||||
- name: Push docker image to registry
|
||||
run: docker push 10.5.1.5:5000/hasslesstech/sdlc-container
|
13
backend/Dockerfile-armv7
Normal file
13
backend/Dockerfile-armv7
Normal file
@ -0,0 +1,13 @@
|
||||
FROM cmosh/alpine-arm AS build
|
||||
|
||||
RUN apk add python3
|
||||
RUN mkdir /venv /app
|
||||
RUN python3 -m venv /venv
|
||||
ENV PATH="/venv/bin:$PATH"
|
||||
|
||||
RUN apk add build-base linux-headers musl-dev python3-dev libpq-dev
|
||||
RUN pip3 install flask uwsgi psycopg2
|
||||
|
||||
EXPOSE 9090/tcp
|
||||
|
||||
ENTRYPOINT ["uwsgi", "--http", ":9090", "--callable", "app", "--wsgi-file", "/app/main.py"]
|
@ -8,13 +8,6 @@ ENV PATH="/venv/bin:$PATH"
|
||||
RUN apk add build-base linux-headers musl-dev python3-dev libpq-dev
|
||||
RUN pip3 install flask uwsgi psycopg2
|
||||
|
||||
|
||||
|
||||
#FROM alpine:latest AS prod
|
||||
|
||||
#RUN apk add python3
|
||||
#ENV PATH="/venv/bin:$PATH"
|
||||
#COPY --from=build /venv /venv
|
||||
EXPOSE 9090/tcp
|
||||
|
||||
ENTRYPOINT ["uwsgi", "--http", ":9090", "--callable", "app", "--wsgi-file", "/app/main.py"]
|
Loading…
x
Reference in New Issue
Block a user