-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to a local instance of Postgres with Docker Compose #546
Draft
wlinator
wants to merge
17
commits into
main
Choose a base branch
from
tess-local-postgres
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…ironment configuration refactor: simplify .env.example by removing unnecessary variables and adding TUX_ENV variable chore: update .gitignore to ignore new environment files refactor: simplify settings.yml.example by removing unnecessary variables
…nt variables and settings This new configuration file will load environment variables from .env files based on the TUX_ENV variable. It also loads settings from a YAML file and provides a Config class to access these settings. This change was made to centralize configuration management and improve code readability.
feat(constants.py): hardcode EMBED_COLORS and EMBED_ICONS for simplicity and to avoid unnecessary config file dependencies
…configuration management The Constants module was replaced with a Config module in multiple files. This change was made to improve the management of configuration variables, making it easier to modify and maintain them. The Config module provides a more flexible and scalable way to handle configuration settings.
This commit introduces the initial database schema for the application. It includes the creation of several tables such as "Guild", "GuildConfig", "Case", "Snippet", "Note", "Reminder", "AFKModel", "Starboard", and "StarboardMessage". Each table has its own set of columns, constraints, and indices. In addition, the commit also introduces a migration lock file for Prisma, which is crucial for managing database migrations in a team environment. This file should not be edited manually and should be included in the version control system.
…iner name to 'tux-bot' for better clarity feat(docker-compose.dev.yml): add environment variable support for development environment feat(docker-compose.dev.yml): change .env path to .env.dev for development environment feat(docker-compose.dev.yml): add volume mapping for application code and postgres initialization script feat(docker-compose.dev.yml): add entrypoint for postgres service to run initialization script feat(docker-compose.dev.yml): change healthcheck command for postgres service chore(docker-compose.dev.yml): comment out adminer service as it's not needed in development environment feat(scripts/postgres-init.sh): add new script for postgres initialization with dynamic password setup
…nding feat(pyproject.toml): add 'package-mode' set to false to disable package mode feat(pyproject.toml): add 'emojis' package to the dependencies for emoji support chore(pyproject.toml): move 'emojis' package from the bottom to the correct alphabetical order in the dependencies feat(pyproject.toml): add 'cache-dir' in 'tool.ruff' for caching ruff files feat(pyproject.toml): add 'tool.prisma' configuration for Prisma ORM settings
…pp/.cache/prisma refactor(Dockerfile): remove 'prisma py fetch' from CMD as it's no longer needed for the application to run
…from including cache files in the build context
… development environment chore(docker-compose.dev.yml): add .cache/ to watch ignore list to prevent unnecessary rebuilds feat(docker-compose.dev.yml): trigger rebuild on changes to pyproject.toml and poetry.lock for dependency updates refactor(docker-compose.dev.yml): remove leading ./ from .env.dev path for consistency feat(docker-compose.dev.yml): add command to bot service to install dependencies and run prisma commands before starting the app feat(docker-compose.dev.yml): uncomment adminer service for database management feat(docker-compose.dev.yml): add environment variables and command to adminer service for automatic login feat(docker-compose.dev.yml): add adminer-index.php config for automatic login script style(docker-compose.dev.yml): add newline at end of file for POSIX compliance
…find .env file automatically feat(config.py): add POSTGRES_DB and POSTGRES_USER environment variables for more flexible database configuration fix(config.py): update DATABASE_URL to include new POSTGRES_DB and POSTGRES_USER variables for accurate database connection string
This script allows to set environment variables for different environments (dev, prod) by sourcing respective .env files. It also backs up existing .env file, and exports additional dynamically computed variables. This change is done to simplify and automate the process of environment configuration.
- Removed the logic for loading environment-specific .env files based on TUX_ENV. Now, only a single .env file is loaded. - Removed the generation of DATABASE_URL from other environment variables. Now, it is directly fetched from the environment variables. - These changes were made to simplify the configuration process and reduce potential points of failure.
…ming convention fix(docker-compose.dev.yml): change .env.dev to .env for environment file path to match production environment refactor(docker-compose.dev.yml): rename volume from tux_data to data for consistency feat(docker-compose.dev.yml): use environment variables for adminer default settings for better security and configurability
…o correctly ignore backup environment files
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This draft is an introduction to moving to a local Postgres instance. The goal is to have a dev and a prod
docker-compose.yml
file, the latter uses the official image we push to our new package registry.Current issues to keep in mind:
docker exec -it tux poetry run prisma db push
docker-compose.dev.yaml
is added for now, run it with the following command:Note: you can access adminer at port
8080
on the host. Select "PostgreSQL" and add the following credentials:postgres
.env
filepostgres