Compare commits

..

6 Commits
0.1.2 ... 0.1.4

Author SHA1 Message Date
Herculino Trotta
023ceb898f Merge pull request #7
github(release): cache build process
2024-12-27 11:25:52 -03:00
Herculino Trotta
1243dddd5d github(release): cache build process 2024-12-27 11:24:56 -03:00
Herculino Trotta
8661fb39e8 github(release): disable provenance when building image 2024-12-27 11:20:44 -03:00
Herculino Trotta
5752606fec docker(prod): update docker-compose.prod.yml to use registry image 2024-12-27 11:20:14 -03:00
Herculino Trotta
7250ce0dbb Merge pull request #6
github(release): drop support for arm besides arm64
2024-12-27 03:24:25 -03:00
Herculino Trotta
b963a3cfb8 github(release): drop support for arm besides arm64 2024-12-27 03:23:51 -03:00
3 changed files with 25 additions and 9 deletions

View File

@@ -34,13 +34,29 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/prod/django/Dockerfile
push: true
provenance: false
tags: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8,linux/arm64/v8
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

View File

@@ -3,7 +3,7 @@ services:
build:
context: .
dockerfile: ./docker/prod/django/Dockerfile
image: ${SERVER_NAME}
image: ghcr.io/eitchtee/wygiwyh:latest
container_name: ${SERVER_NAME}
command: /start
ports:
@@ -27,7 +27,6 @@ services:
procrastinate:
<<: *django
image: ${PROCRASTINATE_NAME}
container_name: ${PROCRASTINATE_NAME}
depends_on:
- db

View File

@@ -6,16 +6,16 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
&& rm -rf /var/lib/apt/lists/*
COPY ./requirements.txt .
RUN pip wheel --wheel-dir /usr/src/app/wheels -r requirements.txt
RUN --mount=type=cache,target=/root/.cache/pip \
pip wheel --wheel-dir /usr/src/app/wheels -r requirements.txt
FROM node:lts-alpine AS webpack_build
WORKDIR /usr/src/frontend
COPY ./frontend .
COPY ./app/templates /usr/src/app/templates
RUN npm config set registry https://registry.npmmirror.com/ && \
RUN --mount=type=cache,target=/root/.npm \
npm install --verbose && \
npm run build && \
npm cache clean --force
npm run build
FROM python:3.11-slim-buster AS python-run-stage
COPY --from=webpack_build /usr/src/frontend/build /usr/src/frontend/build
@@ -29,12 +29,13 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
RUN apt-get update && \
RUN --mount=type=cache,target=/root/.cache/apt \
apt-get update && \
apt-get install --no-install-recommends -y gettext && \
rm -rf /var/lib/apt/lists/* && \
pip install --upgrade pip && \
pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* && \
rm -rf /wheels/ ~/.cache/pip/*
rm -rf /wheels/
COPY --chown=app:app ./docker/prod/django/start /start
COPY --chown=app:app ./docker/prod/procrastinate/start /start-procrastinate