Skip to content

Commit

Permalink
CI/CD: add upgrade packages in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tristiisch committed Mar 19, 2024
1 parent 5885e01 commit 9cd7f6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ jobs:
outputs:
environment: ${{ steps.environment.outputs.environment }}
version_tag: ${{ steps.environment.outputs.tag }}
docker_tags: ${{ steps.docker_tags.outputs.tags }}
last_release_ref: ${{ steps.last_release.outputs.last_release_ref }}
commit_messages: ${{ steps.commit_messages.outputs.commit_messages }}
if: github.event_name == 'push'
Expand Down Expand Up @@ -202,19 +201,6 @@ jobs:
fi
echo "Output $GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
- name: Set Docker Image tags
id: docker_tags
run: |
TAGS=""
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
TAGS="${{ env.REGISTRY_IMAGE }}:${{ steps.environment.outputs.tag }}"
TAGS="$TAGS,${{ env.REGISTRY_IMAGE_PRIVATE }}:${{ needs.compile.outputs.version }}-${{ needs.compile.outputs.commit_id }}"
if [ "${{ steps.environment.outputs.tag }}" = "latest" ]; then
TAGS="$TAGS,${{ env.REGISTRY_IMAGE }}:${{ needs.compile.outputs.version}}"
fi
echo "tags=$(echo "$TAGS" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
echo "Output $GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
- name: Get Github last release tag
id: last_release
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ LABEL version="$VERSION-$GIT_COMMIT_ID"

# Install necessary dependencies
RUN apk update && \
apk add --no-cache ffmpeg opus-dev binutils && \
rm -rf /var/cache/apk/* /etc/apk/cache/* /root/.cache/*
apk upgrade && \
apk add --no-cache ffmpeg opus-dev binutils && \
rm -rf /var/cache/apk/* /etc/apk/cache/* /root/.cache/*

# Set the working directory in the container
WORKDIR /app
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
COMPOSE_SERVICE := pyramid
VENV_NAME := .venv
DOCKER_COMPOSE_FILE_DEV := docker-compose.dev.yml
DOCKER_COMPOSE_FILE_PREPROD := docker-compose.preprod.yml
DOCKER_SERVICE_PREPROD := pyramid_preprod_pyramid
DOCKER_CONTEXT_PREPROD := cookie-pulsheberg
Expand All @@ -10,6 +11,8 @@ DOCKER_CONTEXT_PREPROD := cookie-pulsheberg
# else
# endif

all: start-f logs

start:
@docker compose up -d --remove-orphans

Expand Down Expand Up @@ -48,8 +51,8 @@ env-setup:
@make env
@pip install -r requirements.txt

dev: start-f
${MAKE} logs
dev:
@docker compose -f $(DOCKER_COMPOSE_FILE_DEV) up -d --remove-orphans --build

img-b:
python scripts/environnement.py --build
Expand Down
6 changes: 0 additions & 6 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,4 @@ services:
volumes:
- ./docker/pyramid/logs:/app/logs
- ./docker/pyramid/songs:/app/songs
networks:
- pyramid_dev_network
env_file: .env

networks:
pyramid_dev_network:
driver: bridge

0 comments on commit 9cd7f6a

Please sign in to comment.