I want to setup an expo project with bun runtime and dockerize the project so other developer can work on similar environment with me. what is the most straightforward way to do this?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Setting up an Expo project with the Bun runtime and Dockerizing it for a consistent development environment across your team is a great idea. Below is the most straightforward way to achieve this:
Steps to Set Up the Project
1. Initialize an Expo Project with Bun
First, create a new Expo project and configure it to use Bun.
bash
# Install Bun globally (if not already installed)
curl https://bun.sh/install | bash
# Create a new Expo project
npx create-expo-app my-expo-app --template blank
cd my-expo-app
# Install dependencies with Bun
bun install
2. Create a Dockerfile
Create a Dockerfile in the root of your project to Dockerize the development environment.
Dockerfile
# Use the official Bun image as the base
FROM oven/bun:latest
# Set the working directory
WORKDIR /app
# Copy package.json and bun.lockb (or package-lock.json)
COPY package.json bun.lockb ./
# Install dependencies
RUN bun install
# Copy the rest of the application code
COPY . .
# Expose the Expo development server port
EXPOSE 19000 19002
# Start the Expo development server
CMD ["bun", "expo", "start"]
3. Create a docker-compose.yml File
To simplify the development workflow, create a docker-compose.yml file.