ci: add docker image creation
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m22s
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m22s
This commit is contained in:
31
.gitea/workflows/docker-build.yml
Executable file
31
.gitea/workflows/docker-build.yml
Executable file
@@ -0,0 +1,31 @@
|
||||
name: Docker Build and Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: git.kolibrios.org
|
||||
username: kolibrios
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name == 'push' }}
|
||||
tags: git.kolibrios.org/kolibrios/kolibrios.org:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,7 +17,6 @@ htmlcov/
|
||||
docs/_build/
|
||||
|
||||
# Our's
|
||||
Dockerfile
|
||||
.env
|
||||
static/*.css
|
||||
static/*.css.map
|
||||
|
||||
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM node:18-alpine as sass
|
||||
|
||||
RUN npm install -g sass
|
||||
WORKDIR /build
|
||||
COPY ./static ./static
|
||||
RUN sass ./static:./static \
|
||||
--no-source-map \
|
||||
--style=compressed
|
||||
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
COPY --from=sass /build/static/ ./static/
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
ENV FLASK_ENV=production
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80", "--workers", "4"]
|
||||
@@ -8,3 +8,4 @@ Jinja2==3.1.6
|
||||
libsass==0.23.0
|
||||
MarkupSafe==3.0.2
|
||||
Werkzeug==3.1.3
|
||||
gunicorn
|
||||
|
||||
Reference in New Issue
Block a user