Skip to content

Commit

Permalink
fix: actions with poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Apr 3, 2024
1 parent 9402aca commit 8caad92
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 262 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backend-linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r ./backend/requirements.txt
pip install poetry
poetry install --directory=./backend
- name: Execute linting checks
run: flake8 --config ./backend/.flake8 ./backend
4 changes: 2 additions & 2 deletions .github/workflows/backend-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r ./backend/requirements.txt
pip install poetry
poetry install --directory=./backend
- name: Compile translations
run: django-admin compilemessages
- name: Execute tests
Expand Down
1 change: 1 addition & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.1.0"
description = ""
authors = ["Topvennie <vincent@vallaeys.com>"]
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.11.4"
Expand Down
158 changes: 79 additions & 79 deletions development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,94 +3,94 @@ version: "3.9"
############################# NETWORKS

networks:
selab_network:
name: selab_network
driver: bridge
ipam:
config:
- subnet: 192.168.90.0/24
selab_network:
name: selab_network
driver: bridge
ipam:
config:
- subnet: 192.168.90.0/24

############################# EXTENSIONS

x-common-keys-selab: &common-keys-selab
networks:
- selab_network
security_opt:
- no-new-privileges:true
restart: unless-stopped
environment:
TZ: $TZ
PUID: $PUID
PGID: $PGID
env_file:
- .env
networks:
- selab_network
security_opt:
- no-new-privileges:true
restart: unless-stopped
environment:
TZ: $TZ
PUID: $PUID
PGID: $PGID
env_file:
- .env

############################# SERVICES

services:
nginx:
<<: *common-keys-selab
image: nginx:latest
container_name: nginx
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- ${DATA_DIR}/nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro
- ${SSL_DIR}:/etc/nginx/ssl:ro
depends_on:
- backend
- frontend
nginx:
<<: *common-keys-selab
image: nginx:latest
container_name: nginx
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- ${DATA_DIR}/nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro
- ${SSL_DIR}:/etc/nginx/ssl:ro
depends_on:
- backend
- frontend

backend:
<<: *common-keys-selab
container_name: backend
build:
context: $BACKEND_DIR
dockerfile: Dockerfile
command: /bin/bash -c "./setup.sh && python manage.py runsslserver 192.168.90.2:8080"
expose:
- 8080
volumes:
- ${BACKEND_DIR}:/code
backend:
<<: *common-keys-selab
container_name: backend
build:
context: $BACKEND_DIR
dockerfile: Dockerfile
command: /bin/bash -c "./setup.sh && python manage.py runsslserver 192.168.90.2:8080"
expose:
- 8080
volumes:
- ${BACKEND_DIR}:/code

celery:
<<: *common-keys-selab
container_name: celery
build:
context: $BACKEND_DIR
dockerfile: Dockerfile.dev
command: celery -A ypovoli worker -l DEBUG
volumes:
- ${BACKEND_DIR}:/code
depends_on:
- backend
- redis
celery:
<<: *common-keys-selab
container_name: celery
build:
context: $BACKEND_DIR
dockerfile: Dockerfile.dev
command: celery -A ypovoli worker -l DEBUG
volumes:
- ${BACKEND_DIR}:/code
depends_on:
- backend
- redis

frontend:
<<: *common-keys-selab
container_name: frontend
build:
context: $FRONTEND_DIR
dockerfile: Dockerfile.dev
command: bash -c "npm install && npm run host"
expose:
- 5173
volumes:
- ${FRONTEND_DIR}:/app
depends_on:
- backend
frontend:
<<: *common-keys-selab
container_name: frontend
build:
context: $FRONTEND_DIR
dockerfile: Dockerfile.dev
command: bash -c "npm install && npm run host"
expose:
- 5173
volumes:
- ${FRONTEND_DIR}:/app
depends_on:
- backend

redis:
<<: *common-keys-selab
container_name: redis
image: redis:latest
networks:
selab_network:
ipv4_address: $REDIS_IP
expose:
- $REDIS_PORT
entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- ${DATA_DIR}/redis:/data
redis:
<<: *common-keys-selab
container_name: redis
image: redis:latest
networks:
selab_network:
ipv4_address: $REDIS_IP
expose:
- $REDIS_PORT
entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- ${DATA_DIR}/redis:/data
180 changes: 90 additions & 90 deletions production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,106 +3,106 @@ version: "3.9"
############################# NETWORKS

networks:
selab_network:
name: selab_network
driver: bridge
ipam:
config:
- subnet: 192.168.90.0/24
selab_network:
name: selab_network
driver: bridge
ipam:
config:
- subnet: 192.168.90.0/24

############################# EXTENSIONS

x-common-keys-selab: &common-keys-selab
networks:
- selab_network
security_opt:
- no-new-privileges:true
restart: unless-stopped
environment:
TZ: $TZ
PUID: $PUID
PGID: $PGID
env_file:
- .env
networks:
- selab_network
security_opt:
- no-new-privileges:true
restart: unless-stopped
environment:
TZ: $TZ
PUID: $PUID
PGID: $PGID
env_file:
- .env

############################# SERVICES

services:
nginx:
<<: *common-keys-selab
image: nginx:latest
container_name: nginx
ports:
- 80:80
- 443:443
volumes:
- ${DATA_DIR}/nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro
- ${SSL_DIR}:/etc/nginx/ssl:ro
depends_on:
- backend
- frontend
nginx:
<<: *common-keys-selab
image: nginx:latest
container_name: nginx
ports:
- 80:80
- 443:443
volumes:
- ${DATA_DIR}/nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro
- ${SSL_DIR}:/etc/nginx/ssl:ro
depends_on:
- backend
- frontend

postgres:
<<: *common-keys-selab
image: postgres:15.2
container_name: postgres
networks:
selab_network:
ipv4_address: $POSTGRES_IP
environment:
POSTGRES_DB: $POSTGRES_DB
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
expose:
- $POSTGRES_PORT
volumes:
- ${DATA_DIR}/postgres:/var/lib/postgresql/data
postgres:
<<: *common-keys-selab
image: postgres:15.2
container_name: postgres
networks:
selab_network:
ipv4_address: $POSTGRES_IP
environment:
POSTGRES_DB: $POSTGRES_DB
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
expose:
- $POSTGRES_PORT
volumes:
- ${DATA_DIR}/postgres:/var/lib/postgresql/data

backend:
<<: *common-keys-selab
container_name: backend
build:
context: $BACKEND_DIR
dockerfile: Dockerfile
command: bash -c "./setup.sh && gunicorn --config gunicorn_config.py ypovoli.wsgi:application"
expose:
- 8080
depends_on:
- postgres
backend:
<<: *common-keys-selab
container_name: backend
build:
context: $BACKEND_DIR
dockerfile: Dockerfile
command: bash -c "./setup.sh && gunicorn --config gunicorn_config.py ypovoli.wsgi:application"
expose:
- 8080
depends_on:
- postgres

redis:
<<: *common-keys-selab
container_name: redis
image: redis:latest
networks:
selab_network:
ipv4_address: $REDIS_IP
expose:
- $REDIS_PORT
entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- ${DATA_DIR}/redis:/data
redis:
<<: *common-keys-selab
container_name: redis
image: redis:latest
networks:
selab_network:
ipv4_address: $REDIS_IP
expose:
- $REDIS_PORT
entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- ${DATA_DIR}/redis:/data

celery:
<<: *common-keys-selab
container_name: celery
build:
context: $BACKEND_DIR
dockerfile: Dockerfile.prod
command: celery -A ypovoli worker -l ERROR
volumes:
- ${BACKEND_DIR}:/code
depends_on:
- backend
- redis
celery:
<<: *common-keys-selab
container_name: celery
build:
context: $BACKEND_DIR
dockerfile: Dockerfile.prod
command: celery -A ypovoli worker -l ERROR
volumes:
- ${BACKEND_DIR}:/code
depends_on:
- backend
- redis

frontend:
<<: *common-keys-selab
container_name: frontend
build:
context: $FRONTEND_DIR
dockerfile: Dockerfile.prod
expose:
- 3000
depends_on:
- backend
frontend:
<<: *common-keys-selab
container_name: frontend
build:
context: $FRONTEND_DIR
dockerfile: Dockerfile.prod
expose:
- 3000
depends_on:
- backend
Loading

0 comments on commit 8caad92

Please sign in to comment.