Open
Conversation
Explanation of Key Parts Section Purpose image Uses a Microsoft-maintained Node.js 18 image (includes git, curl, etc.). features Adds Java 17 (for Android builds), Docker-in-Docker (if you need to run Android emulators in containers – not typical), and Ruby (for CocoaPods). postCreateCommand Runs a setup script (see below) after the container is created. This script installs React Native CLI, CocoaPods, Watchman, and Android SDK. forwardPorts Exposes Metro bundler (8081) and Expo ports. customizations Configures VS Code with essential extensions and settings for React Native. remoteUser Runs as node user to avoid permission issues with mounted files. Accompanying Script: .devcontainer/post-create.sh
Set up a Dockerfile for Node.js development environment with Java 17, React Native CLI, CocoaPods, and Watchman.
This script sets up the Android SDK by downloading command line tools, accepting licenses, and installing required SDK components.
This file contains hidden or 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
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.
🔍 What This Achieves
· Full control over the database image: you can modify the postgres/Dockerfile to add extensions, change config, or use a different base.
· Persistent database data via Docker volume.
· App and database run in separate containers but are networked together.
· Environment variables like DATABASE_URL are available in your app container.
🛠️ Customizing Further
· MySQL/MongoDB: Replace the db service with mysql or mongo and adjust the Dockerfile accordingly.
· Initialization scripts: Add .sql or .sh files to /docker-entrypoint-initdb.d/ (PostgreSQL/MySQL) to create schemas or seed data automatically.
· Database configuration: Mount custom my.cnf (MySQL) or postgresql.conf (PostgreSQL) into the container.
This setup gives you maximum flexibility while keeping your development environment isolated and reproducible.