generated from FGA0138-MDS-Ajax/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/FGA0138-MDS-Ajax/2024-1-RIGEL
- Loading branch information
Showing
12 changed files
with
326 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
__pycache__ | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.db | ||
*.sqlite3 | ||
*.sqlite | ||
|
||
# Diretórios do Django | ||
driverplan/media | ||
driverplan/static | ||
driverplan/__pycache__ | ||
driverplan/*.log | ||
driverplan/*.pot | ||
|
||
# Arquivos e diretórios comuns a serem ignorados | ||
.DS_Store | ||
Thumbs.db | ||
.env | ||
.venv | ||
venv | ||
ENV | ||
env | ||
build | ||
dist | ||
eggs | ||
parts | ||
sdist | ||
var | ||
*.egg-info | ||
.installed.cfg | ||
*.egg | ||
|
||
# Arquivos e diretórios de configuração do editor/IDE | ||
.idea | ||
.vscode | ||
*.sublime-workspace | ||
|
||
# Diretório de testes | ||
htmlcov | ||
.coverage | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
/djangoapp/static/ | ||
/djangoapp/media/ | ||
/djangoapp/project/local_settings.py | ||
gunicorn-error-log | ||
__localcode | ||
/data/ | ||
|
||
# Django # | ||
*.log | ||
*.pot | ||
*.pyc | ||
__pycache__ | ||
db.sqlite3 | ||
# db.sqlite3 ---> modificar (pois será mudado para postegreSQL) | ||
|
||
# Backup files # | ||
*.bak | ||
|
||
# If you are using PyCharm # | ||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
|
||
# AWS User-specific | ||
.idea/**/aws.xml | ||
|
||
# Generated files | ||
.idea/**/contentModel.xml | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# File-based project format | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Python # | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Distribution / packaging | ||
.Python build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
.pytest_cache/ | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery | ||
celerybeat-schedule.* | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# Sublime Text # | ||
*.tmlanguage.cache | ||
*.tmPreferences.cache | ||
*.stTheme.cache | ||
*.sublime-workspace | ||
*.sublime-project | ||
|
||
# sftp configuration file | ||
sftp-config.json | ||
|
||
# Package control specific files Package | ||
Control.last-run | ||
Control.ca-list | ||
Control.ca-bundle | ||
Control.system-ca-bundle | ||
GitHub.sublime-settings | ||
|
||
# Visual Studio Code # | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,65 @@ | ||
FROM python:3.9 | ||
SHELL ["/bin/bash", "-c"] | ||
# Set environment variables | ||
FROM python:3.12.3-alpine3.20 | ||
LABEL mantainer="[email protected]" | ||
|
||
# SHELL ["/bin/bash", "-c"] | ||
|
||
# Essa variável de ambiente é usada para controlar se o Python deve | ||
# gravar arquivos de bytecode (.pyc) no disco. 1 = Não, 0 = Sim | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
# Define que a saída do Python será exibida imediatamente no console ou em | ||
# outros dispositivos de saída, sem ser armazenada em buffer. | ||
# Em resumo, você verá os outputs do Python em tempo real. | ||
ENV PYTHONUNBUFFERED 1 | ||
RUN mkdir -p /app | ||
COPY driverplan/manage.py /app | ||
COPY driverplan/requirements.txt /app | ||
COPY driverplan/driverplan /app/driverplan | ||
RUN apt update | ||
RUN apt full-upgrade -y | ||
RUN apt install -y python3 pip pkg-config | ||
RUN apt install -y python3-dev default-libmysqlclient-dev build-essential | ||
WORKDIR /app | ||
RUN pip install Django mysqlclient pyTelegramBotAPI python-decouple | ||
CMD python3 manage.py migrate --noinput && python3 manage.py collectstatic --noinput && python3 manage.py runserver 0.0.0.0:8000 | ||
|
||
# RUN mkdir -p /app | ||
|
||
# Copia a pasta "driverplan" e "scripts" para dentro do container | ||
COPY driverplan /driverplan | ||
COPY scripts /scripts | ||
# COPY driverplan/manage.py /app | ||
# COPY driverplan/requirements.txt /app | ||
# COPY driverplan/driverplan /app/driverplan | ||
|
||
# Entra na pasta driverplan no container | ||
WORKDIR /driverplan | ||
|
||
# A porta 800 estará disponível para conexões externas ao container | ||
# É a porta que será usada para o django | ||
EXPOSE 8000 | ||
|
||
# RUN executa comandos em um shell dentro do container para construir a imagem. | ||
# O resultado da execução do comando é armazenado no sistema de arquivos da | ||
# imagem como uma nova camada. | ||
# Agrupar os comandos em um único RUN pode reduzir a quantidade de camadas da | ||
# imagem e torná-la mais eficiente. | ||
RUN python -m venv /venv && \ | ||
/venv/bin/pip install --upgrade pip && \ | ||
/venv/bin/pip install -r /driverplan/requirements.txt && \ | ||
adduser --disabled-password --no-create-home duser && \ | ||
mkdir -p /data/web/static && \ | ||
mkdir -p /data/web/media && \ | ||
chown -R duser:duser /venv && \ | ||
chown -R duser:duser /data/web/static && \ | ||
chown -R duser:duser /data/web/media && \ | ||
chmod -R 755 /data/web/static && \ | ||
chmod -R 755 /data/web/media && \ | ||
chmod -R +x /scripts | ||
|
||
#RUN apt update | ||
#RUN apt full-upgrade -y | ||
#RUN apt install -y python3 pip pkg-config | ||
#RUN apt install -y python3-dev default-libmysqlclient-dev build-essential | ||
|
||
# Adiciona a pasta scripts e venv/bin | ||
# no $PATH do container. | ||
ENV PATH="/scripts:/venv/bin:$PATH" | ||
|
||
# Mudar o usuário para duser | ||
USER duser | ||
|
||
# RUN pip install Django mysqlclient pyTelegramBotAPI python-decouple | ||
|
||
# CMD python3 manage.py migrate --noinput && python3 manage.py collectstatic --noinput && python3 manage.py runserver 0.0.0.0:8000 | ||
|
||
CMD ["commands.sh"] |
Binary file modified
BIN
+6 Bytes
(100%)
DrivePlanSite/DrivePlanSite/__pycache__/urls.cpython-312.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: '3.9' | ||
|
||
services: | ||
driverplan: | ||
container_name: driverplan | ||
build: | ||
context: . | ||
# infomrar caminho do docker file (caso necessario): <./Dockerfile> | ||
ports: | ||
- 8000:8000 | ||
volumes: | ||
- ./driverplan:/driverplan | ||
- ./data/web/static:/data/web/static/ | ||
- ./data/web/media:/data/web/media/ | ||
env_file: | ||
- ./dotenv_files/.env | ||
depends_on: | ||
- psql | ||
psql: | ||
container_name: psql | ||
image: postgres:13-alpine | ||
volumes: | ||
- ./data/postgres/data:/var/lib/postgresql/data/ | ||
env_file: | ||
- ./dotenv_files/.env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
SECRET_KEY="CHANGE-ME" | ||
# gerador de senha de 50 digitos pela função interna do Django | ||
# python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())" | ||
|
||
# 0 False, 1 True | ||
DEBUG="1" | ||
|
||
# Comma Separated values | ||
ALLOWED_HOSTS="127.0.0.1, localhost" | ||
|
||
DB_ENGINE="django.db.backends.postgresql" | ||
POSTGRES_DB="CHANGE-ME" | ||
POSTGRES_USER="CHANGE-ME" | ||
POSTGRES_PASSWORD="CHANGE-ME" | ||
POSTGRES_HOST="localhost" # localhost -> no servidor; "psql" -> hostname | ||
POSTGRES_PORT="5432" |
Oops, something went wrong.