Skip to content

Docker compose#4

Open
drobilc wants to merge 3 commits intomasterfrom
feat/docker-compose
Open

Docker compose#4
drobilc wants to merge 3 commits intomasterfrom
feat/docker-compose

Conversation

@drobilc
Copy link
Copy Markdown
Contributor

@drobilc drobilc commented Jan 28, 2026

This pull request migrates the development workflow to use a fully containerized Docker-based setup, streamlining how services are started and managed. The changes remove the custom Node/Bun orchestrator script in favor of Docker Compose, introduce a new development Dockerfile, and update documentation and configuration files accordingly.

Development workflow overhaul:

  • Replaced the custom orchestrator script (scripts/dev.ts) with a Docker Compose-based approach for managing all dev services. ([scripts/dev.tsL1-L108](https://github.com/zerodays/full-stack-starter/pull/4/files#diff-653680a4ce21b1015ba542020323435170fd8e5803dd2edd75c2ae70c9cfb075L1-L108))
  • Added a new Dockerfile.dev for building the development environment using the Bun runtime. ([Dockerfile.devR1-R8](https://github.com/zerodays/full-stack-starter/pull/4/files#diff-86930c95a19b82f7e64a962a0053d44e855824813019b3698eae4917a90cdcacR1-R8))
  • Updated .dockerignore to exclude unnecessary files from Docker build context, improving build efficiency. ([.dockerignoreR1-R15](https://github.com/zerodays/full-stack-starter/pull/4/files#diff-2f754321d62f08ba8392b9b168b83e24ea2852bb5d815d63e767f6c3d23c6ac5R1-R15))
  • Revised docker-compose.dev.yml to define separate services for the app (vite), database migrations (migrator), and Drizzle Studio (studio), all depending on a healthy PostgreSQL instance. Services now share code via volumes for live reload. ([docker-compose.dev.ymlR19-R70](https://github.com/zerodays/full-stack-starter/pull/4/files#diff-9542f82d64bbeebd91f6236324bfe199e9657e2cb1fd9779d5d6dcdcf9cd4de1R19-R70))

Configuration and dependency updates:

  • Updated package.json scripts to launch the dev environment via Docker Compose and removed the concurrently dependency. ([[1]](https://github.com/zerodays/full-stack-starter/pull/4/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L7-R8), [[2]](https://github.com/zerodays/full-stack-starter/pull/4/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L39))
  • Updated documentation in README.md to reflect the new Docker-based workflow and explain how to rebuild containers when dependencies change. ([README.mdL48-R60](https://github.com/zerodays/full-stack-starter/pull/4/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L48-R60))

@drobilc drobilc requested a review from zigapk January 28, 2026 09:11
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @drobilc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the local development environment by transitioning from a custom script-based orchestration to a fully containerized Docker Compose setup. This change aims to standardize how development services are initiated and managed, providing a more consistent and isolated environment for all developers. The update simplifies the setup process, improves dependency management, and enhances the overall developer experience by leveraging Docker's capabilities for service coordination and live code reloading.

Highlights

  • Development Workflow Migration: The custom Node/Bun orchestrator script (scripts/dev.ts) has been replaced by a Docker Compose-based setup for managing development services, streamlining the local environment.
  • Containerized Development Environment: A new Dockerfile.dev is introduced to build a dedicated development environment using the Bun runtime, ensuring consistent setups across development machines.
  • Service Orchestration with Docker Compose: docker-compose.dev.yml is updated to define and manage migrator, vite (app), and studio services, all dependent on a healthy PostgreSQL instance, with shared volumes for live code reloading.
  • Dependency Management Streamlining: The concurrently dependency has been removed from package.json and bun.lock as its functionality is now natively handled by Docker Compose for service coordination.
  • Improved Documentation and Configuration: README.md is updated to reflect the new Docker-based workflow, and a .dockerignore file is added to optimize Docker build contexts by excluding unnecessary files.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a great step towards containerizing the development environment, which will improve consistency and onboarding. The migration from a custom script to Docker Compose is well-executed. I've identified a few areas for improvement:

  • The docker-compose.dev.yml file has significant repetition that can be reduced using YAML anchors for better maintainability.
  • The dev script in package.json doesn't forward arguments, which breaks the documented --build functionality.
  • The README.md contains an incorrect command for rebuilding containers.
    My review includes suggestions to address these points.

"scripts": {
"dev": "infisical run -- bun -b concurrently --names \"DOCKER,APP\" -c \"blue,magenta\" \"bun run db:start\" \"bun run db:wait && bun run dev:app\"",
"dev:app": "concurrently --names \"VITE,STUDIO\" -c \"cyan,yellow\" \"vite dev\" \"bun run db:studio\"",
"dev": "infisical export --format=dotenv > .env.docker && docker compose -f docker-compose.dev.yml up",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The dev script doesn't forward arguments to docker compose up. This means bun dev --build (as mentioned in README.md) won't work as expected because the --build flag isn't passed to Docker Compose. To fix this, you can wrap the command in sh -c to correctly handle and forward any arguments.

Suggested change
"dev": "infisical export --format=dotenv > .env.docker && docker compose -f docker-compose.dev.yml up",
"dev": "sh -c 'infisical export --format=dotenv > .env.docker && docker compose -f docker-compose.dev.yml up \"$@\"' --",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works in bun.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow okay bun is smart

Comment on lines +20 to +70
# One-time task to run migrations
migrator:
build:
context: .
dockerfile: Dockerfile.dev
command: bun drizzle-kit migrate
depends_on:
postgres:
condition: service_healthy
env_file: .env.docker
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}

vite:
build:
context: .
dockerfile: Dockerfile.dev
env_file: .env.docker
environment:
- WATCHPACK_POLLING=true
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
command: bun run dev:app --host=0.0.0.0
ports:
- "5173:5173"
volumes:
- .:/app # Edits on host are reflected in container
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully

studio:
build:
context: .
dockerfile: Dockerfile.dev
env_file: .env.docker
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
command: bun run db:studio --port 4983 --host 0.0.0.0
ports:
- "4983:4983"
volumes:
- .:/app # Edits on host are reflected in container
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The definitions for migrator, vite, and studio services share a lot of common configuration, such as build, env_file, and environment. This repetition can make the file harder to maintain. Consider using YAML anchors and aliases to reduce duplication. For example, you could define a common build block and reuse it:

x-common-build: &common-build
  build:
    context: .
    dockerfile: Dockerfile.dev

services:
  migrator:
    <<: *common-build
    # ... rest of migrator config
  vite:
    <<: *common-build
    # ... rest of vite config

You can apply a similar pattern for other repeated sections like environment or volumes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Literally no one can read this. I think we can leave as is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean, arent we all yaml fans and experts

**Note on dependencies**: Since `node_modules` are cached, you must rebuild the containers if you add or change packages. You can do this by running:

```bash
bun dev --build
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The command bun dev --build is not the correct way to pass arguments to a bun script; this passes the --build flag to bun itself, not the script. To pass arguments to the script, you should use bun dev -- --build. Please update the documentation to reflect the correct command usage.

Suggested change
bun dev --build
bun dev -- --build

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works in bun.

Base automatically changed from feat/hono-rpc to master January 28, 2026 09:48
Comment on lines +21 to +31
migrator:
build:
context: .
dockerfile: Dockerfile.dev
command: bun drizzle-kit migrate
depends_on:
postgres:
condition: service_healthy
env_file: .env.docker
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a ideja je, da maš prazno bazo k je prpravlena, če pa hočš staging bazo jo pa separately itak popolnoma povozš (torej ni nekih konfliktov?)

Comment on lines +20 to +70
# One-time task to run migrations
migrator:
build:
context: .
dockerfile: Dockerfile.dev
command: bun drizzle-kit migrate
depends_on:
postgres:
condition: service_healthy
env_file: .env.docker
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}

vite:
build:
context: .
dockerfile: Dockerfile.dev
env_file: .env.docker
environment:
- WATCHPACK_POLLING=true
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
command: bun run dev:app --host=0.0.0.0
ports:
- "5173:5173"
volumes:
- .:/app # Edits on host are reflected in container
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully

studio:
build:
context: .
dockerfile: Dockerfile.dev
env_file: .env.docker
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
command: bun run db:studio --port 4983 --host 0.0.0.0
ports:
- "4983:4983"
volumes:
- .:/app # Edits on host are reflected in container
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean, arent we all yaml fans and experts

"scripts": {
"dev": "infisical run -- bun -b concurrently --names \"DOCKER,APP\" -c \"blue,magenta\" \"bun run db:start\" \"bun run db:wait && bun run dev:app\"",
"dev:app": "concurrently --names \"VITE,STUDIO\" -c \"cyan,yellow\" \"vite dev\" \"bun run db:studio\"",
"dev": "infisical export --format=dotenv > .env.docker && docker compose -f docker-compose.dev.yml up",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow okay bun is smart

"scripts": {
"dev": "infisical run -- bun -b concurrently --names \"DOCKER,APP\" -c \"blue,magenta\" \"bun run db:start\" \"bun run db:wait && bun run dev:app\"",
"dev:app": "concurrently --names \"VITE,STUDIO\" -c \"cyan,yellow\" \"vite dev\" \"bun run db:studio\"",
"dev": "infisical export --format=dotenv > .env.docker && docker compose -f docker-compose.dev.yml up",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a normal infisical run does not work? damn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants