-
Notifications
You must be signed in to change notification settings - Fork 2
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
59 deploy refactor coaching platform #73
Conversation
477362a
to
39db1b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking very good Levi, thank you for this. Some initial feedback/questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good. Thank you, especially, for all of the fantastic documentation. That's super helpful. I just left a few questions.
Dockerfile
Outdated
RUN apt-get update && apt-get install -y \ | ||
libssl1.1 \ | ||
ca-certificates \ | ||
libpq5 \ | ||
&& rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always curious how one determines exactly what is needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this part to make sure the container has all the system dependencies needed for the Rust app to run correctly, specifically libraries and certificates. libssl1.1
for SSL support, ca-certificates for verifying HTTPS
connections, and libpq5
for PostgreSQL
connections. Clearing /var/lib/apt/lists just reduces image size by removing cached package data. Hope that helps.
4a4140e
to
fd99832
Compare
FYI: Built the working image using this .env file: # PostgreSQL environment variables for local development
POSTGRES_USER=refactor # Default PostgreSQL user for local development
POSTGRES_PASSWORD=password # Default PostgreSQL password for local development
POSTGRES_DB=refactor # Default PostgreSQL database for local development
POSTGRES_HOST=postgres # The local Docker Compose PostgreSQL container hostname
POSTGRES_PORT=5432 # PostgreSQL default port for local development
POSTGRES_SCHEMA=refactor_platform # PostgreSQL schema for the application
# Database connection URL for the Rust application
DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
# Rust application environment variables
SERVICE_INTERFACE=0.0.0.0
SERVICE_PORT=4000
# App user configuration
USERNAME=appuser # Username for the non-root user in the container
USER_UID=1000 # User ID for the appuser
USER_GID=1000 # Group ID for the appuser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still builds and functions well for me with your latest commit. I think it's great for our first version. Thanks for working together to get this across the finish line with me.
a708624
to
276c150
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great @lmcdonough, thank you for this. A few suggested changes inline. Could you also add a short section to the main README.md file that points a reader to the container README for how to build/start the containerized application?
### **Convert DBML to SQL** | ||
|
||
If you have a DBML file (`schema.dbml`), you can convert it into an SQL schema: | ||
|
||
If you have a DBML file (`schema.dbml`), convert it to SQL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part isn't really needed since a developer is responsible for converting the DBML diagram to a .sql file as part of their commit if they change the DB's table structures.
…for the Coaching & Mentoring Platform
…ner setup section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request includes significant changes to set up a Rust web application with PostgreSQL using Docker and Docker Compose. It also provides detailed documentation for deployment and usage. The most important changes include the creation of a
Dockerfile
for building and running the Rust application, adocker-compose.yaml
file for orchestrating services, and comprehensive documentation for setup and deployment.Docker and Docker Compose Setup:
Dockerfile
: Created a multi-stage Dockerfile to build the Rust application and set up the environment for running it with PostgreSQL. This includes installing necessary dependencies, copying the source code, and defining environment variables and health checks.docker-compose.yaml
: Added a Docker Compose configuration to define services for the Rust application and PostgreSQL. This includes environment variables, ports, and network configurations.Documentation:
docs/runbooks/Container-README.md
: Added a comprehensive README for setting up and running the Rust web application with PostgreSQL using Docker and Docker Compose. This includes prerequisites, project setup, building and running the application, using database utilities, and troubleshooting.docs/runbooks/deploy.md
: Added a detailed deployment runbook for deploying the Rust application on an Ubuntu server using Ansible and Terraform. This covers both containerized and native deployment methods, including initial server setup, application deployment, and Terraform configuration.## Descriptiondescribe the intent of your changes here
GitHub Issue: Resolves #59
Changes
Testing Strategy
describe how you or someone else can test and verify the changes
Concerns
describe any concerns that might be worth mentioning or discussing