add workflow for building containers
This commit is contained in:
parent
99152733ce
commit
393b426e85
33
.gitea/workflows/build-container-backend.yaml
Normal file
33
.gitea/workflows/build-container-backend.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
name: build-container-backend
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
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 gitea
|
||||
git checkout gitea/master
|
||||
- name: Build docker image
|
||||
run: docker build backend/ -f backend/Dockerfile-x86_64 -t 10.5.1.5:5000/sdlc/x86_64
|
||||
- name: Push docker image to registry
|
||||
run: docker push 10.5.1.5:5000/sdlc/x86_64
|
||||
|
||||
# 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 gitea
|
||||
# git checkout gitea/master
|
||||
# - name: Build docker image
|
||||
# run: docker build backend/ -f backend/Dockerfile-armv7 -t 10.5.1.5:5000/sdlc/armv7
|
||||
# - name: Push docker image to registry
|
||||
# run: docker push 10.5.1.5:5000/sdlc/armv7
|
13
backend/Dockerfile-armv7
Normal file
13
backend/Dockerfile-armv7
Normal file
@ -0,0 +1,13 @@
|
||||
FROM cmosh/alpine-arm AS build
|
||||
|
||||
RUN apk --update 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"]
|
@ -1,6 +1,6 @@
|
||||
FROM alpine:latest AS build
|
||||
|
||||
RUN apk add python3
|
||||
RUN apk --update add python3
|
||||
RUN mkdir /venv /app
|
||||
RUN python3 -m venv /venv
|
||||
ENV PATH="/venv/bin:$PATH"
|
||||
@ -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