Skip to content

Commit

Permalink
Merge pull request #488 from pablodiegoss/update-project-structure
Browse files Browse the repository at this point in the history
Refactor project structure to avoid indirection on multiple folders
  • Loading branch information
rodrigocam authored Oct 30, 2022
2 parents 0cf8270 + f1ee03f commit 819a4e3
Show file tree
Hide file tree
Showing 217 changed files with 96 additions and 707 deletions.
File renamed without changes.
37 changes: 37 additions & 0 deletions .envs/.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Use this file to create a .env with filled variables
# Django Variables
DJANGO_DEBUG=True
DJANGO_SETTINGS_MODULE=config.settings
DJANGO_ADMIN_URL=admin/
DEV_DB=False
DEV_STATIC=True
DEBUG_TOOLBAR=True
DJANGO_SECRET_KEY=change_me
USE_MINIO=True

## Amazon AWS Variables
AWS_ACCESS_KEY_ID=minio
AWS_SECRET_ACCESS_KEY=minio123
MINIO_ROOT_USER=minio
MINIO_ROOT_PASSWORD=minio123
AWS_STORAGE_BUCKET_NAME=jandig-cdn
AWS_PRIVATE_STORAGE_BUCKET_NAME=jandig-private-cdn
AWS_S3_REGION_NAME=us-east-2
AWS_STATIC_LOCATION=static
MINIO_S3_ENDPOINT_URL=http://storage:9000
MINIO_SITE_REGION=us-east-2
MINIO_USER_ACCESS_KEY=minio-access-key
MINIO_USER_SECRET_KEY=minio-secret-key

## Postgres variables
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_DB=goldpenny
POSTGRES_USER=goldpenny
POSTGRES_PASSWORD=goldpenny123

# Email server variables
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
[email protected]
JANDIG_EMAIL_PASSWORD=local_password
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM python:3.10-slim-bullseye

RUN apt-get update && \
apt-get install -y --no-install-recommends \
gettext \
docutils-common \
curl \
wget


COPY ./pyproject.toml /pyproject.toml
COPY ./poetry.lock /poetry.lock


RUN curl -sSL https://install.python-poetry.org | python3 -

ENV PATH="$PATH:/root/.local/bin" \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
TINI_VERSION=v0.19.0

RUN poetry install

RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}" -O /usr/local/bin/tini \
&& chmod +x /usr/local/bin/tini && tini --version

RUN mkdir -p /src
WORKDIR /src
COPY ./src/ /src/
COPY ./docs/ /src/docs/
COPY ./locale/ /src/locale/
COPY ./tasks.py /src/tasks.py
COPY ./run.sh /src/run.sh
COPY ./etc/ /src/etc/

RUN pip install --upgrade pip

RUN find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf


ENTRYPOINT ["tini", "--"]
40 changes: 0 additions & 40 deletions Makefile

This file was deleted.

22 changes: 11 additions & 11 deletions docker/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ version: '3.5'
services:
django:
image: jandigarte/django:latest
restart: "no"
build:
context: ../
dockerfile: ./docker/Dockerfile
dockerfile: Dockerfile
ports:
- 8000:8000
volumes:
- ../src/ARte/:/ARte/src/ARte/
- ../locale/:/ARte/locale/
- ./media/:/ARte/src/ARte/users/media/
- ../run.sh:/ARte/run.sh
- ./src/:/src/
- ./docs/:/src/docs/
- ./etc/:/src/etc/
- ./locale/:/src/locale/
- ./run.sh:/src/run.sh
- ./tasks.py:/src/tasks.py
env_file:
- ../src/.envs/.env
- .envs/.env
depends_on:
- postgres
- storage
Expand All @@ -25,7 +25,7 @@ services:
postgres:
image: postgres:12.6
env_file:
- ../src/.envs/.env
- .envs/.env
command: postgres -c max_connections=10000
ports:
- "5432:5432"
Expand All @@ -40,15 +40,15 @@ services:
volumes:
- storage:/storage
env_file:
- ../src/.envs/.env
- .envs/.env
command: server /storage --console-address ":9001"

createbuckets:
image: minio/mc
depends_on:
- storage
env_file:
- ../src/.envs/.env
- .envs/.env
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc config host add myminio $${MINIO_S3_ENDPOINT_URL} $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD}) do echo '...waiting...' && sleep 1; done;
Expand Down
32 changes: 0 additions & 32 deletions docker/Dockerfile

This file was deleted.

136 changes: 0 additions & 136 deletions docker/docker-compose.deploy.yml

This file was deleted.

Loading

0 comments on commit 819a4e3

Please sign in to comment.