Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: CI-pipeline
on:
workflow_dispatch:
push:
branches:
- dev

pull_request:
branches:
- main
types:
- opened

jobs:
linters:
Expand Down Expand Up @@ -57,9 +55,6 @@ jobs:
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}

- name: Check fail
run: echo "Unreachable"

- name: Notify in telegram about success
uses: appleboy/telegram-action@master
with:
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY ./mysite ./mysite
COPY ./polls ./polls
COPY ./manage.py .

RUN ./manage.py makemigrations
# RUN ./manage.py migrate

COPY docker-entrypoint.sh .
Expand Down
11 changes: 11 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pipeline {
agent any

stages {
stage('Hello') {
steps {
echo 'Hello from Jenkins'
}
}
}
}
26 changes: 20 additions & 6 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
services:
app:
container_name: wtukatyr/django-example-app:latest
django-app:
image: wtukatyr/django-example-app:latest
container_name: django-app
ports:
- "8989:8000"
depends_on:
- db
volumes:
- ./mysite:/app/mysite
- ./polls:/app/polls
environment:
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
Expand All @@ -14,7 +18,9 @@ services:
env_file:
- .env
networks:
- proxy-common
- django_app_network
- proxy_common

db:
image: postgres:14
restart: always
Expand All @@ -30,13 +36,21 @@ services:
volumes:
- pg-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: sa
POSTGRES_PASSWORD: example
POSTGRES_PORT: 5432
POSTGRES_DB: ${DATABASE_NAME}
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_PORT: ${DATABASE_PORT}
env_file:
- .env
networks:
- django_app_network
- proxy_common

volumes:
pg-data:

networks:
django_app_network:
name: django_app_network
proxy_common:
external: true
3 changes: 3 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
echo "Collect static files"
python manage.py collectstatic --noinput


# Apply database migrations
echo "Make migrations"
RUN ./manage.py makemigrations
echo "Apply database migrations"
python manage.py migrate

Expand Down
5 changes: 3 additions & 2 deletions mysite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False

ALLOWED_HOSTS = ["localhost"]
CSRF_TRUSTED_ORIGINS = ["https://app.saccada.xyz"]
ALLOWED_HOSTS = ["localhost", "app.saccada.xyz"]


# Application definition
Expand Down
Loading