File tree Expand file tree Collapse file tree 5 files changed +20
-31
lines changed Expand file tree Collapse file tree 5 files changed +20
-31
lines changed Original file line number Diff line number Diff line change 2
2
.git
3
3
.github
4
4
.gitignore
5
+ renovate.json
6
+ README.md
5
7
6
8
# Django
7
9
* .log
8
10
* .pot
9
11
* .pyc
10
12
* .sqlite3
11
13
* .sqlite3-journal
12
- __pycache__ /
13
- migrations /
14
14
15
- # General Directories
15
+ # General directories
16
16
.idea
17
17
.graphql
18
18
media-content
19
19
fixtures
20
20
docs
21
21
tmp
22
+ __pycache__
23
+ migrations
22
24
23
25
# General files
24
26
* .md
25
27
.env
26
28
.env.defaults
27
- renovate.json
28
29
pytest.ini
29
30
30
31
# Docker files
Original file line number Diff line number Diff line change @@ -32,16 +32,15 @@ jobs:
32
32
- name : Set Tag
33
33
id : set-tag
34
34
run : |
35
- if [[ -z "${{ github.event.inputs.tag }}" && -z "${GITHUB_REF# refs/tags/} " ]]; then
35
+ if [[ "${{ github.ref }}" == " refs/heads/develop " ]]; then
36
36
echo "::set-output name=tag::latest"
37
+ elif [[ -z "${{ github.event.inputs.tag }}" && -n "${GITHUB_REF#refs/tags/}" ]]; then
38
+ echo "::set-output name=tag::latest"
39
+ elif [[ -n "${{ github.event.inputs.tag }}" ]]; then
40
+ echo "::set-output name=tag::${{ github.event.inputs.tag }}"
37
41
else
38
- if [ -z "${{ github.event.inputs.tag }}" ]; then
39
- echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
40
- else
41
- echo "::set-output name=tag::${{ github.event.inputs.tag }}"
42
- fi
42
+ echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
43
43
fi
44
-
45
44
- name : Build and Push Docker Image
46
45
run : |
47
46
docker buildx create --use
Original file line number Diff line number Diff line change 1
- # Stage 1: Build stage
2
- FROM python:3.12.3-slim AS builder
3
-
4
- # Set the working directory in the container
1
+ FROM python:3.11.9-slim AS base
5
2
WORKDIR /usr/src
3
+ COPY . /usr/src/
6
4
7
- # Install system dependencies and upgrade pip
5
+ FROM base AS scaffold
8
6
RUN apt-get update \
9
7
&& apt-get install -y --no-install-recommends \
10
8
build-essential \
11
9
libpq-dev \
12
10
&& rm -rf /var/lib/apt/lists/* \
13
11
&& pip install --upgrade pip
14
12
15
- # Copy only the dependency files to leverage caching
16
- COPY pyproject.toml poetry.lock /usr/src/
17
-
18
- # Install project dependencies
13
+ FROM scaffold AS dependencies
19
14
RUN pip install poetry==1.5.0 \
20
15
&& poetry config virtualenvs.create false \
21
16
&& poetry install --no-interaction --no-ansi
22
17
23
- # Copy the rest of the project code
24
- COPY . /usr/src/
25
-
26
- # Stage 2: Final image
27
- FROM builder AS final
28
-
29
- # Define your environment variables
18
+ FROM dependencies AS final
30
19
ENV PYTHONDONTWRITEBYTECODE 1
31
20
ENV PYTHONUNBUFFERED 1
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ services:
10
10
- default
11
11
env_file : .env
12
12
labels :
13
- - " traefik.enable=true "
13
+ - " traefik.enable=${TRAEFIK_ENABLE} "
14
14
- " traefik.http.routers.anitrend.rule=Host(`${HOST}`)"
15
15
- " traefik.http.routers.anitrend.entrypoints=web,websecure"
16
16
- " traefik.http.routers.anitrend.service=anitrend"
17
17
- " traefik.http.routers.anitrend.tls=true"
18
- - " traefik.http.routers.anitrend.tls.certresolver=staging "
18
+ - " traefik.http.routers.anitrend.tls.certresolver=${CERT_RESOLVER} "
19
19
- " traefik.http.services.anitrend.loadbalancer.server.port=${PORT}"
20
20
logging :
21
21
options :
Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ services:
8
8
- default
9
9
env_file : .env
10
10
labels :
11
- - " traefik.enable=true "
11
+ - " traefik.enable=${TRAEFIK_ENABLE} "
12
12
- " traefik.http.routers.anitrend.rule=Host(`${HOST}`)"
13
13
- " traefik.http.routers.anitrend.entrypoints=web,websecure"
14
14
- " traefik.http.routers.anitrend.service=anitrend"
15
15
- " traefik.http.routers.anitrend.tls=true"
16
- - " traefik.http.routers.anitrend.tls.certresolver=production "
16
+ - " traefik.http.routers.anitrend.tls.certresolver=${CERT_RESOLVER} "
17
17
- " traefik.http.services.anitrend.loadbalancer.server.port=${PORT}"
18
18
logging :
19
19
options :
You can’t perform that action at this time.
0 commit comments