Skip to content

Commit

Permalink
refactor: optimize image building
Browse files Browse the repository at this point in the history
  • Loading branch information
j3rrryy committed Jan 8, 2025
1 parent 80f7e47 commit fa7edaa
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 28 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Cloud Storage

<p align="center">
<img src="https://github.com/j3rrryy/cloud_storage/actions/workflows/main.yml/badge.svg">
<a href="https://github.com/j3rrryy/cloud_storage/actions/workflows/main.yml">
<img src="https://github.com/j3rrryy/cloud_storage/actions/workflows/main.yml/badge.svg" alt="СI/CD">
</a>
<a href="https://www.python.org/downloads/release/python-3120/">
<img src="https://img.shields.io/badge/Python-3.12-FFD64E.svg" alt="Python 3.12">
</a>
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
env_file:
- ./dev/.env
volumes:
- ./src/gateway/:/app/
- ./src/gateway/:/app
networks:
- nginx_network
- main_network
Expand All @@ -63,7 +63,7 @@ services:
env_file:
- ./dev/.env
volumes:
- ./src/auth/:/app/
- ./src/auth/:/app
networks:
- main_network
- auth_network
Expand Down Expand Up @@ -105,7 +105,7 @@ services:
env_file:
- ./dev/.env
volumes:
- ./src/files/:/app/
- ./src/files/:/app
networks:
- main_network
- files_network
Expand Down Expand Up @@ -195,7 +195,7 @@ services:
env_file:
- ./dev/.env
volumes:
- ./src/mail/:/app/
- ./src/mail/:/app
networks:
- mail_network
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion examples/dev/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ APP_NAME="Cloud Storage"
VERSION=1.0.0
DEBUG=1
SECRET_KEY={"kty": "OKP", "crv": "Ed25519", "x": "<key>", "d": "<key>", "alg": "EdDSA"}
ALLOWED_ORIGINS="<origin>, <origin>"
ALLOWED_ORIGINS="<origin:port>, <origin:port>"

MAIL_USERNAME=<username>
MAIL_PASSWORD=<password>
Expand Down
2 changes: 1 addition & 1 deletion examples/prod/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ APP_NAME="Cloud Storage"
VERSION=1.0.0
DEBUG=0
SECRET_KEY={"kty": "OKP", "crv": "Ed25519", "x": "<key>", "d": "<key>", "alg": "EdDSA"}
ALLOWED_ORIGINS="<origin>, <origin>"
ALLOWED_ORIGINS="<origin:port>, <origin:port>"

MAIL_USERNAME=<username>
MAIL_PASSWORD=<password>
Expand Down
9 changes: 5 additions & 4 deletions src/auth/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.vscode
.ruff_cache
.gitignore
**/.vscode
**/.DS_Store
**/.gitignore
**/__pycache__
**/.ruff_cache
venv
__pycache__
Dockerfile
.dockerignore
2 changes: 1 addition & 1 deletion src/auth/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __new__(cls, *args, **kwargs):
postgres: PostgresConfig


def load_config() -> Config:
def load_config():
env = Env()
env.read_env()

Expand Down
9 changes: 5 additions & 4 deletions src/files/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.vscode
.ruff_cache
.gitignore
**/.vscode
**/.DS_Store
**/.gitignore
**/__pycache__
**/.ruff_cache
venv
__pycache__
Dockerfile
.dockerignore
2 changes: 1 addition & 1 deletion src/files/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __new__(cls, *args, **kwargs):
minio: MinioConfig


def load_config() -> Config:
def load_config():
env = Env()
env.read_env()

Expand Down
9 changes: 5 additions & 4 deletions src/gateway/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.vscode
.ruff_cache
.gitignore
**/.vscode
**/.DS_Store
**/.gitignore
**/__pycache__
**/.ruff_cache
venv
__pycache__
Dockerfile
.dockerignore
2 changes: 1 addition & 1 deletion src/gateway/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __new__(cls, *args, **kwargs):
app: AppConfig


def load_config() -> Config:
def load_config():
env = Env()
env.read_env()

Expand Down
9 changes: 5 additions & 4 deletions src/mail/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.vscode
.ruff_cache
.gitignore
**/.vscode
**/.DS_Store
**/.gitignore
**/__pycache__
**/.ruff_cache
venv
__pycache__
Dockerfile
.dockerignore
2 changes: 1 addition & 1 deletion src/mail/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __new__(cls, *args, **kwargs):
smtp: SMTPConfig


def load_config() -> Config:
def load_config():
env = Env()
env.read_env()

Expand Down
2 changes: 1 addition & 1 deletion src/mail/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
async def main():
consumer = connect_kafka_service()
service = MailService(consumer)
await service.process_messages()
load_config().app.logger.info("Server started")
await service.process_messages()


if __name__ == "__main__":
Expand Down

0 comments on commit fa7edaa

Please sign in to comment.