Skip to content

Conversation

PraaneshSelvaraj
Copy link
Contributor

What’s Added

This PR adds support for Dev Container. It makes it easy to get started with PokeAPI in a consistent, containerized development environment.

Highlights

  • Added .devcontainer/devcontainer.json:
    • Uses docker-compose.yml and docker-compose-dev.yml
    • Sets up Python, Black formatter, and common ports (8000, 8080, 80, 443)
    • Automatically installs tools and builds the database on startup

How to Use

  1. Open the repo in VS Code
  2. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run:
    Dev Containers: Reopen in Container
  3. You’re ready to develop!

Why It’s Useful

  • No need to install dependencies manually
  • Works on Windows, macOS, and Linux
  • Speeds up onboarding for new contributors

Fixes #1251

@PraaneshSelvaraj
Copy link
Contributor Author

Hey @Naramsim,
I’ve set up the Dev Container for the project, check it out when you have a moment.
If it looks good, I’ll add the setup instructions. Should I put them in README.md or CONTRIBUTING.md?

@Naramsim
Copy link
Member

Naramsim commented Jun 1, 2025

Hi, I suggest two things:

  • initially write a simple instraction section in the CONTRIBUTING.md file referencing how to use the devcontainer
  • second, to use the docker-compose.override.yml so to pull pokeapi/pokeapi from docker hub without building it locally. And maybe we could not build the DB since it takes a long time.

@Naramsim
Copy link
Member

Naramsim commented Jun 1, 2025

in my case the HTTPS port didn't work and the 80 was mounted on http://localhost:35499/api/v2/ . So a bit counterintuitive.

Secondly, the git inside the container not usable, nor detected by VSCode that prompts me to install git. I think this devcontainers aren't really useful afterall, honestly.

@PraaneshSelvaraj
Copy link
Contributor Author

Hey, I will work on fixing these issues. After that, we can decide whether to keep or remove the devcontainer based on what works best.

@PraaneshSelvaraj
Copy link
Contributor Author

@Naramsim I have fixed the issues and added instructions in the CONTIRUBTING.md. Do check it out and tell me if you face any issues.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The image from Docker Hub automatically starts the Gunicorn server, but for our Dev Container setup, we actually don't want it running by default. I've overridden the CMD to prevent that, as we use make commands to handle server startup.

To keep the main docker-compose.override.yml clean for its original purpose, I set up a separate override file just for the Dev Container here: .devcontainer/docker-compose-override.yml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For Dev Container features like docker-outside-of-docker (and others), we typically need a Debian-based image for them to work properly.

Since our current image is built on Alpine Linux, I would suggest creating a separate Dockerfile inside the .devcontainers folder. This dedicated Dockerfile would then build our Dev Container image using a Debian base.

What do you think of this?

Copy link
Member

Choose a reason for hiding this comment

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

Hi, honestly I think it's too much work with few benefits :) If you like you could work on other issues.

Top two would be: helping @Indyandie with the new Astro website, polishing the openapi schema and make it available in the current website

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @Naramsim,

Totally get where you're coming from on keeping things simple, and I completely agree that we shouldn't add complexity without good reason.

But, just wanted to quickly mention why I think Dev Containers could actually save us headaches long-term: it means anyone can jump in and contribute instantly, without wrestling with setup. It ensures everyone's development environment is the same, so we avoid "it works on my machine" issues. Plus, it works well with features like cloud development (like GitHub Codespaces).

It feels like a small upfront effort for a much smoother ride for all contributors, especially new ones.

If you still think this isn't required, I'll totally drop it and focus on other things.

Copy link
Member

Choose a reason for hiding this comment

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

Hi @PraaneshSelvaraj sorry for coming back only now. I'm currently unable to fully review the devcontainer file honestly. Maybe I'll just merge it in and see if issues arise when people start using it. Still unsure. I have limited time currently

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @Naramsim , Sounds good.

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.

Feature: Add Dev Container for Easy Development Setup
2 participants