-
Notifications
You must be signed in to change notification settings - Fork 1
開発環境を作成 #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
base: feature/submission-domain
Are you sure you want to change the base?
開発環境を作成 #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye | ||
|
|
||
| # Install additional tools | ||
| RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
| && apt-get -y install --no-install-recommends \ | ||
| curl \ | ||
| wget \ | ||
| git \ | ||
| unzip \ | ||
| zip \ | ||
| default-mysql-client \ | ||
| vim \ | ||
| lsof \ | ||
| net-tools | ||
|
|
||
| # Install Docker CLI | ||
| RUN apt-get update && apt-get install -y \ | ||
| ca-certificates \ | ||
| curl \ | ||
| gnupg \ | ||
| lsb-release \ | ||
| && mkdir -p /etc/apt/keyrings \ | ||
| && curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ | ||
| && echo \ | ||
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ | ||
| $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \ | ||
| && apt-get update \ | ||
| && apt-get install -y docker-ce-cli | ||
|
|
||
| # Clean up | ||
| RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Set the default user to vscode | ||
| USER vscode | ||
|
|
||
| # Set working directory | ||
| WORKDIR /workspace |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,73 @@ | ||||||
| { | ||||||
| "name": "Mofe API Dev Container", | ||||||
| "dockerComposeFile": ["../compose.yaml", "docker-compose.yml"], | ||||||
| "service": "app", | ||||||
| "workspaceFolder": "/workspace", | ||||||
|
||||||
| "workspaceFolder": "/workspace", | |
| "workspaceFolder": "/workspaces/mofe-api", |
Copilot
AI
Feb 17, 2026
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.
The postStartCommand attempts to start Docker with "sudo service docker start", but this command is unlikely to work in a devcontainer environment. Devcontainers typically use Docker-outside-of-Docker pattern where the Docker socket is mounted from the host. This command may fail or be unnecessary. Consider removing this command or using a different approach if Docker-in-Docker is truly needed.
| "postStartCommand": "sudo service docker start", |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| services: | ||
| app: | ||
| build: | ||
| context: .. | ||
| dockerfile: .devcontainer/Dockerfile | ||
| volumes: | ||
| - ..:/workspaces/mofe-api:cached | ||
| command: sleep infinity | ||
| network_mode: service:db | ||
| depends_on: | ||
| - db | ||
| - rabbitmq | ||
|
|
||
| db: | ||
| image: 'mariadb:latest' | ||
| restart: unless-stopped | ||
| environment: | ||
| - 'MARIADB_DATABASE=cafecoder_back_rails_development' | ||
| - 'MARIADB_PASSWORD=password' | ||
| - 'MARIADB_ROOT_PASSWORD=password' | ||
| - 'MARIADB_USER=root' | ||
| ports: | ||
| - '3306:3306' | ||
| volumes: | ||
| - mariadb-data:/var/lib/mysql | ||
| - ./dump.sql:/docker-entrypoint-initdb.d/dump.sql | ||
|
|
||
| rabbitmq: | ||
| image: 'rabbitmq:3-management' | ||
| restart: unless-stopped | ||
| environment: | ||
| - 'RABBITMQ_DEFAULT_PASS=secret' | ||
| - 'RABBITMQ_DEFAULT_USER=myuser' | ||
| ports: | ||
| - '5672:5672' | ||
| - '15672:15672' | ||
| volumes: | ||
| - rabbitmq-data:/var/lib/rabbitmq | ||
|
|
||
| volumes: | ||
| mariadb-data: | ||
| rabbitmq-data: |
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.
The devcontainer.json references '../compose.yaml' in the dockerComposeFile array, but the compose.yaml file in the repository root defines different service configurations (mysql, mariadb, rabbitmq) with different environment variables than those used in docker-compose.yml. This could lead to confusion or conflicts. The devcontainer should either use only docker-compose.yml or the compose files should be harmonized to avoid configuration mismatches.