diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 06fe5c6..2548246 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,6 +12,7 @@ "ghcr.io/devcontainers/features/java:latest": { "installGradle": true, "installMaven": true, + "mavenVersion": "3.9.10", "version": "21" }, "ghcr.io/devcontainers/features/node:latest": {}, diff --git a/README.md b/README.md index 77ad6fe..bec39ce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GitHub Copilot Vibe Coding Workshop -![GitHub Copilot - Ghiblifiled](./images/ghcp.jpg) +![GitHub Copilot Vibe Coding Workshop](./images/banner.png) Let's vibe-code with [GitHub Copilot](https://docs.github.com/copilot/about-github-copilot/what-is-github-copilot) and its newest and greatest features in various programming languages such as Python, JavaScript, Java and .NET, as well as make the apps cloud-native by containerization. Are you ready to jump in? diff --git a/complete/Dockerfile.dotnet b/complete/Dockerfile.dotnet index 460ced0..ecb5eba 100644 --- a/complete/Dockerfile.dotnet +++ b/complete/Dockerfile.dotnet @@ -25,9 +25,10 @@ EXPOSE 8080 # Set the environment variables ENV ASPNETCORE_URLS=http://+:8080 ENV DOTNET_RUNNING_IN_CONTAINER=true +ENV ApiSettings__BaseUrl="${ApiSettings__BaseUrl}" # Copy the published files from the build stage COPY --from=publish /app/publish . # Set the entry point for the container -ENTRYPOINT ["dotnet", "Contoso.BlazorApp.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "Contoso.BlazorApp.dll"] diff --git a/complete/Dockerfile.java b/complete/Dockerfile.java index 16d8f8b..06422d9 100644 --- a/complete/Dockerfile.java +++ b/complete/Dockerfile.java @@ -1,55 +1,90 @@ -# Stage 1: Build the application -FROM mcr.microsoft.com/openjdk/jdk:21-ubuntu AS build +# Multi-stage build for Java Spring Boot application +# Stage 1: Build stage with Microsoft OpenJDK 21 +FROM mcr.microsoft.com/openjdk/jdk:21-ubuntu AS builder -WORKDIR /app +# Set working directory for build +WORKDIR /workspace -# Copy gradle files for dependency resolution -COPY java/socialapp/gradle/ ./gradle/ -COPY java/socialapp/gradlew java/socialapp/build.gradle java/socialapp/settings.gradle ./ +# Copy Gradle configuration files +COPY java/socialapp/gradle ./gradle +COPY java/socialapp/gradlew . +COPY java/socialapp/gradlew.bat . +COPY java/socialapp/build.gradle . +COPY java/socialapp/settings.gradle . -# Give executable permissions to gradlew +# Make gradlew executable RUN chmod +x ./gradlew -# Download dependencies to cache this layer +# Download dependencies (for better Docker layer caching) RUN ./gradlew dependencies --no-daemon # Copy source code COPY java/socialapp/src ./src # Build the application -RUN ./gradlew bootJar --no-daemon +RUN ./gradlew build --no-daemon -x test # Stage 2: Extract JRE from JDK -FROM mcr.microsoft.com/openjdk/jdk:21-ubuntu AS jre-build +FROM mcr.microsoft.com/openjdk/jdk:21-ubuntu AS jre-builder -# Create a custom JRE using jlink that only includes modules needed for the application +# Create a custom JRE using jlink RUN jlink \ - --add-modules java.base,java.compiler,java.desktop,java.instrument,java.management,java.naming,java.prefs,java.rmi,java.security.jgss,java.security.sasl,java.sql,jdk.crypto.ec,jdk.unsupported,jdk.zipfs,jdk.management \ + --add-modules java.base,java.desktop,java.instrument,java.management,java.naming,java.net.http,java.security.jgss,java.sql,jdk.unsupported \ --strip-debug \ --no-man-pages \ --no-header-files \ --compress=2 \ - --output /jre-minimal + --output /custom-jre -# Stage 3: Create final image +# Stage 3: Runtime stage with custom JRE FROM ubuntu:22.04 -# Set environment variables -ENV JAVA_HOME=/opt/jre-minimal +# Install required packages and clean up +RUN apt-get update && \ + apt-get install -y \ + ca-certificates \ + sqlite3 \ + curl \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Copy custom JRE from jre-builder stage +COPY --from=jre-builder /custom-jre /opt/java/openjdk + +# Set JAVA_HOME and update PATH +ENV JAVA_HOME=/opt/java/openjdk ENV PATH="${JAVA_HOME}/bin:${PATH}" -# Copy the extracted JRE from the jre-build stage -COPY --from=jre-build /jre-minimal $JAVA_HOME +# Create application user for security +RUN groupadd -r appuser && useradd -r -g appuser appuser -# Copy the built application from the build stage +# Set working directory WORKDIR /app -COPY --from=build /app/build/libs/*.jar app.jar -# Create a directory for persistent data -RUN mkdir -p /app/data +# Copy the built JAR from builder stage +COPY --from=builder /workspace/build/libs/*.jar app.jar + +# Create SQLite database file with proper permissions +RUN touch sns_api.db && \ + chown appuser:appuser sns_api.db && \ + chmod 664 sns_api.db -# Expose the application port +# Change ownership of the app directory +RUN chown -R appuser:appuser /app + +# Switch to non-root user +USER appuser + +# Set environment variables for GitHub Codespaces +ENV CODESPACE_NAME="${CODESPACE_NAME}" +ENV GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN="${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" + +# Expose port 8080 EXPOSE 8080 -# Set the entrypoint command to run the application -ENTRYPOINT ["java", "-jar", "/app/app.jar"] \ No newline at end of file +# Health check +HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \ + CMD curl -f http://localhost:8080/actuator/health || exit 1 + +# Run the application +ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/complete/compose.yaml b/complete/compose.yaml index 93e8d26..c715390 100644 --- a/complete/compose.yaml +++ b/complete/compose.yaml @@ -1,3 +1,9 @@ +version: '3.8' + +networks: + contoso: + driver: bridge + services: contoso-backend: build: @@ -9,10 +15,14 @@ services: environment: - CODESPACE_NAME=${CODESPACE_NAME} - GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN=${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN} - volumes: - - ./java/socialapp/sns_api.db:/app/sns_api.db networks: - contoso + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] + interval: 30s + timeout: 3s + start_period: 60s + retries: 3 contoso-frontend: build: @@ -21,13 +31,9 @@ services: container_name: contoso-frontend ports: - "3030:8080" - depends_on: - - contoso-backend environment: - - ApiSettings__BaseUrl=http://contoso-backend:8080/api/ + - ApiSettings__BaseUrl=http://contoso-backend:8080/api networks: - contoso - -networks: - contoso: - name: contoso + depends_on: + - contoso-backend diff --git a/complete/dotnet/Contoso.BlazorApp/Components/Pages/Home.razor b/complete/dotnet/Contoso.BlazorApp/Components/Pages/Home.razor index e65b08a..04f4fcb 100644 --- a/complete/dotnet/Contoso.BlazorApp/Components/Pages/Home.razor +++ b/complete/dotnet/Contoso.BlazorApp/Components/Pages/Home.razor @@ -68,9 +68,9 @@ } } - private async Task HandleAuthStateChanged() + private void HandleAuthStateChanged() { - await InvokeAsync(async () => + InvokeAsync(async () => { if (!AuthService.AuthState.IsLoading && !AuthService.AuthState.IsAuthenticated) { diff --git a/complete/dotnet/Contoso.BlazorApp/Services/ApiService.cs b/complete/dotnet/Contoso.BlazorApp/Services/ApiService.cs index 00e6d09..10c315f 100644 --- a/complete/dotnet/Contoso.BlazorApp/Services/ApiService.cs +++ b/complete/dotnet/Contoso.BlazorApp/Services/ApiService.cs @@ -46,10 +46,12 @@ private string GetApiBaseUrl(string configuredBaseUrl) _logger.LogInformation("Using GitHub Codespaces URL: {CodespacesUrl}", codespacesUrl); return codespacesUrl; } - + // Fall back to configured base URL (localhost) - _logger.LogInformation("Using configured base URL: {ConfiguredUrl}", configuredBaseUrl); - return configuredBaseUrl; + // Ensure the URL ends with a forward slash for proper relative path resolution + var normalizedUrl = configuredBaseUrl.TrimEnd('/') + "/"; + _logger.LogInformation("Using configured base URL: {ConfiguredUrl}", normalizedUrl); + return normalizedUrl; } private void SetAuthHeaders() diff --git a/complete/java/socialapp/README.md b/complete/java/README.md similarity index 100% rename from complete/java/socialapp/README.md rename to complete/java/README.md diff --git a/complete/javascript/package-lock.json b/complete/javascript/package-lock.json index 7504da7..00d7784 100644 --- a/complete/javascript/package-lock.json +++ b/complete/javascript/package-lock.json @@ -3052,14 +3052,15 @@ } }, "node_modules/form-data": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { diff --git a/docs/.vscode/mcp.json b/docs/.vscode/mcp.json index f3a9b0e..03dcf99 100644 --- a/docs/.vscode/mcp.json +++ b/docs/.vscode/mcp.json @@ -8,6 +8,15 @@ } ], "servers": { + "awesome-copilot": { + "command": "docker", + "args": [ + "run", + "-i", + "--rm", + "ghcr.io/microsoft/mcp-dotnet-samples/awesome-copilot:latest" + ] + }, "context7": { "command": "npx", "args": [ diff --git a/docs/.vscode/settings.json b/docs/.vscode/settings.json new file mode 100644 index 0000000..51a564d --- /dev/null +++ b/docs/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "chat.tools.autoApprove": true, + "chat.agent.maxRequests": 100 +} \ No newline at end of file diff --git a/docs/00-setup.md b/docs/00-setup.md index 39d56c6..21bb9a8 100644 --- a/docs/00-setup.md +++ b/docs/00-setup.md @@ -18,6 +18,7 @@ Refer to the [README](../README.md) doc for preparation. - [Start Visual Studio Code](#start-visual-studio-code) - [Set-up MCP Servers](#set-up-mcp-servers) - [Check GitHub Copilot Agent Mode](#check-github-copilot-agent-mode) +- [Configure Beast Mode](#configure-beast-mode) - [Prepare Custom Instructions](#prepare-custom-instructions) - [Analyze Product Requirements Document (PRD) and Design API](#analyze-product-requirements-document-prd-and-design-api) @@ -256,6 +257,7 @@ Refer to the [README](../README.md) doc for preparation. ### Set-up MCP Servers +1. Make sure Docker Desktop is up and running if you use VS Code on your local machine. 1. Set the environment variable of `$REPOSITORY_ROOT`. ```bash @@ -284,6 +286,7 @@ Refer to the [README](../README.md) doc for preparation. 1. Open Command Palette by typing F1 or `Ctrl`+`Shift`+`P` on Windows or `Cmd`+`Shift`+`P` on Mac OS, and search `MCP: List Servers`. 1. Choose `context7` then click `Start Server`. +1. Choose `awesome-copilot` then click `Start Server`. ## Check GitHub Copilot Agent Mode @@ -298,6 +301,40 @@ Refer to the [README](../README.md) doc for preparation. 1. Select model to either `GPT-4.1` or `Claude Sonnet 4`. +## Configure Beast Mode + +1. Enter the `/mcp.awesome-copilot.get_search_prompt`, followed by entering keywords like "beast mode" + + It should show list of beast chatmodes. Enter a prompt similar to `4.1 Beast Chat Mode`. Then it will save it under the `.github/chatmodes` directory. + +1. Choose the `4.1-Beast` mode instead of the `Agent` mode. It will automatically change LLM to `GPT 4.1`. + +1. Set the environment variable of `$REPOSITORY_ROOT`. + + ```bash + # bash/zsh + REPOSITORY_ROOT=$(git rev-parse --show-toplevel) + ``` + + ```powershell + # PowerShell + $REPOSITORY_ROOT = git rev-parse --show-toplevel + ``` + +1. Copy workspace settings. + + ```bash + # bash/zsh + cp $REPOSITORY_ROOT/docs/.vscode/settings.json \ + $REPOSITORY_ROOT/.vscode/settings.json + ``` + + ```powershell + # PowerShell + Copy-Item -Path $REPOSITORY_ROOT/docs/.vscode/settings.json ` + -Destination $REPOSITORY_ROOT/.vscode/settings.json -Force + ``` + ## Prepare Custom Instructions 1. Set the environment variable of `$REPOSITORY_ROOT`. diff --git a/docs/05-containerization.md b/docs/05-containerization.md index a2125a3..83076a2 100644 --- a/docs/05-containerization.md +++ b/docs/05-containerization.md @@ -70,14 +70,16 @@ Refer to the [README](../README.md) doc for preparation. ```text I'd like to build a container image of a Java app. Follow the instructions below. - - The Java app is located at `java`. - - Your working directory is the repository root. - Identify all the steps first, which you're going to do. + - The Java app is located at `java/socialapp`. + - Your working directory is the repository root. - Create a Dockerfile, `Dockerfile.java`. - Use Microsoft OpenJDK 21. - Use multi-stage build approach. - Extract JRE from JDK. - Use the target port number of `8080` for the container image. + - Add both environment variables, `CODESPACE_NAME` and `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` from the host to the container image. + - Create an SQLite database file, `sns_api.db`, in the container image. DO NOT Copy the file from the host. ``` 1. Click the ![the keep button image](https://img.shields.io/badge/keep-blue) button of GitHub Copilot to take the changes. @@ -101,6 +103,7 @@ Refer to the [README](../README.md) doc for preparation. Use the container image just built, run a container and verify if the app is running properly. - Use the host port of `8080`. + - Both `CODESPACE_NAME` and `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` values should be the ones from GitHub Codespaces. ``` ### Containerize .NET Application @@ -111,13 +114,14 @@ Refer to the [README](../README.md) doc for preparation. ```text I'd like to build a container image of a .NET app. Follow the instructions below. + - Identify all the steps first, which you're going to do. - The .NET app is located at `dotnet`. - Your working directory is the repository root. - - Identify all the steps first, which you're going to do. - Create a Dockerfile, `Dockerfile.dotnet`. - Use .NET 9. - Use multi-stage build approach. - Use the target port number of `8080` for the container image. + - Add the environment variable, `ApiSettings__BaseUrl` to the container. It should point to the Java app, `http://localhost:8080/api`. ``` 1. Click the ![the keep button image](https://img.shields.io/badge/keep-blue) button of GitHub Copilot to take the changes. @@ -141,12 +145,13 @@ Refer to the [README](../README.md) doc for preparation. Use the container image just built, run a container and verify if the app is running properly. - Use the host port of `3030`. + - Pass the environment variable `ApiSettings__BaseUrl` the value of `http://localhost:8080/api`. ``` 1. Make sure that both frontend and backend apps are NOT communicating with each other because they don't know each other yet. Run the prompt like below. ```text - Regardless or not, remove both containers currently running. + Remove both Java and .NET containers and their respective container images. ``` ### Orchestrate Containers @@ -157,6 +162,7 @@ Refer to the [README](../README.md) doc for preparation. ```text I'd like to create a Docker Compose file. Follow the instructions below. + - Identify all the steps first, which you're going to do. - Your working directory is the repository root. - Use `Dockerfile.java` as a backend app. - Use `Dockerfile.dotnet` as a frontend app. @@ -164,7 +170,8 @@ Refer to the [README](../README.md) doc for preparation. - Use `contoso` as the network name. - Use `contoso-backend` as the container name of the Java app. Its target port is 8080, and host port is 8080. - Use `contoso-frontend` as the container name of the .NET app. Its target port is 8080, and host port is 3030. - - Mount the volume for the database that the Java app uses, `java/socialapp/sns_api.db`. + - Add both environment variables, `CODESPACE_NAME` and `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` from the host to the Java container. + - Add the environment variable, `ApiSettings__BaseUrl` to the .NET container. It should point to the Java app's `/api`. ``` 1. Click the ![the keep button image](https://img.shields.io/badge/keep-blue) button of GitHub Copilot to take the changes. @@ -172,7 +179,7 @@ Refer to the [README](../README.md) doc for preparation. 1. Once the `compose.yaml` file is created, run it and verify if both apps are running properly. ```text - Now, run the Docker compose file and verify if the apps are running properly. + Run the Docker compose file and verify if all the apps are running properly. ``` 1. Open a web browser and navigate to `http://localhost:3030`, and verify if the apps are up and running properly. diff --git a/images/banner.png b/images/banner.png new file mode 100644 index 0000000..007441b Binary files /dev/null and b/images/banner.png differ diff --git a/images/ghcp.jpg b/images/ghcp.jpg deleted file mode 100644 index fd0845b..0000000 Binary files a/images/ghcp.jpg and /dev/null differ diff --git a/localisation/es-es/README.md b/localisation/es-es/README.md index 99a2a0a..10c9542 100644 --- a/localisation/es-es/README.md +++ b/localisation/es-es/README.md @@ -1,6 +1,6 @@ # Taller de Programación Vibe con GitHub Copilot -![GitHub Copilot - Ghiblifiled](../../images/ghcp.jpg) +![Taller de Programación Vibe con GitHub Copilot](../../images/banner.png) ¡Vamos a programar con vibe usando [GitHub Copilot](https://docs.github.com/copilot/about-github-copilot/what-is-github-copilot) y sus características más nuevas y mejores en varios lenguajes de programación como Python, JavaScript, Java y .NET, así como hacer que las aplicaciones sean nativas de la nube mediante contenedorización! ¿Estás listo para sumergirte? diff --git a/localisation/es-es/complete/java/socialapp/README.md b/localisation/es-es/complete/java/README.md similarity index 100% rename from localisation/es-es/complete/java/socialapp/README.md rename to localisation/es-es/complete/java/README.md diff --git a/localisation/es-es/docs/00-setup.md b/localisation/es-es/docs/00-setup.md index 8ae8989..7ea55a3 100644 --- a/localisation/es-es/docs/00-setup.md +++ b/localisation/es-es/docs/00-setup.md @@ -18,6 +18,7 @@ Consulta el documento [README](../README.md) para la preparación. - [Iniciar Visual Studio Code](#iniciar-visual-studio-code) - [Configurar Servidores MCP](#configurar-servidores-mcp) - [Verificar Modo Agente de GitHub Copilot](#verificar-modo-agente-de-github-copilot) +- [Configurar Modo Bestia](#configurar-modo-bestia) - [Preparar Instrucciones Personalizadas](#preparar-instrucciones-personalizadas) - [Analizar Documento de Requisitos del Producto (PRD) y Diseñar API](#analizar-documento-de-requisitos-del-producto-prd-y-diseñar-api) @@ -256,6 +257,7 @@ Consulta el documento [README](../README.md) para la preparación. ### Configurar Servidores MCP +1. Asegúrate de que Docker Desktop esté funcionando si usas VS Code en tu máquina local. 1. Establece la variable de entorno de `$REPOSITORY_ROOT`. ```bash @@ -284,6 +286,7 @@ Consulta el documento [README](../README.md) para la preparación. 1. Abre la Paleta de Comandos presionando F1 o `Ctrl`+`Shift`+`P` en Windows o `Cmd`+`Shift`+`P` en Mac OS, y busca `MCP: List Servers`. 1. Elige `context7` y luego haz clic en `Start Server`. +1. Elige `awesome-copilot` y luego haz clic en `Start Server`. ## Verificar Modo Agente de GitHub Copilot @@ -298,6 +301,40 @@ Consulta el documento [README](../README.md) para la preparación. 1. Selecciona el modelo ya sea `GPT-4.1` o `Claude Sonnet 4`. +## Configurar Modo Bestia + +1. Ingresa `/mcp.awesome-copilot.get_search_prompt`, seguido de palabras clave como "beast mode" + + Debería mostrar la lista de modos de chat bestia. Ingresa un prompt similar a `4.1 Beast Chat Mode`. Luego se guardará bajo el directorio `.github/chatmodes`. + +1. Elige el modo `4.1-Beast` en lugar del modo `Agent`. Automáticamente cambiará el LLM a `GPT 4.1`. + +1. Establece la variable de entorno de `$REPOSITORY_ROOT`. + + ```bash + # bash/zsh + REPOSITORY_ROOT=$(git rev-parse --show-toplevel) + ``` + + ```powershell + # PowerShell + $REPOSITORY_ROOT = git rev-parse --show-toplevel + ``` + +1. Copia la configuración del espacio de trabajo. + + ```bash + # bash/zsh + cp $REPOSITORY_ROOT/docs/.vscode/settings.json \ + $REPOSITORY_ROOT/.vscode/settings.json + ``` + + ```powershell + # PowerShell + Copy-Item -Path $REPOSITORY_ROOT/docs/.vscode/settings.json ` + -Destination $REPOSITORY_ROOT/.vscode/settings.json -Force + ``` + ## Preparar Instrucciones Personalizadas 1. Establece la variable de entorno de `$REPOSITORY_ROOT`. diff --git a/localisation/es-es/docs/05-containerization.md b/localisation/es-es/docs/05-containerization.md index 3ba2d08..c4ddcb2 100644 --- a/localisation/es-es/docs/05-containerization.md +++ b/localisation/es-es/docs/05-containerization.md @@ -70,14 +70,16 @@ Consulta el documento [README](../README.md) para la preparación. ```text Me gustaría construir una imagen de contenedor de una aplicación Java. Sigue las instrucciones a continuación. - - La aplicación Java se encuentra en `java`. - - Tu directorio de trabajo es la raíz del repositorio. - Identifica primero todos los pasos que vas a hacer. + - La aplicación Java se encuentra en `java/socialapp`. + - Tu directorio de trabajo es la raíz del repositorio. - Crea un Dockerfile, `Dockerfile.java`. - Usa Microsoft OpenJDK 21. - Usa el enfoque de construcción multi-etapa. - Extrae JRE del JDK. - Usa el número de puerto objetivo `8080` para la imagen del contenedor. + - Agrega ambas variables de entorno, `CODESPACE_NAME` y `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` del host a la imagen del contenedor. + - Crea un archivo de base de datos SQLite, `sns_api.db`, en la imagen del contenedor. NO copies el archivo del host. ``` 1. Haz clic en el botón ![imagen del botón keep](https://img.shields.io/badge/keep-blue) de GitHub Copilot para tomar los cambios. @@ -101,6 +103,7 @@ Consulta el documento [README](../README.md) para la preparación. Usa la imagen del contenedor recién construida, ejecuta un contenedor y verifica si la aplicación se está ejecutando correctamente. - Usa el puerto del host `8080`. + - Ambos valores `CODESPACE_NAME` y `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` deben ser los de GitHub Codespaces. ``` ### Contenedorizar Aplicación .NET @@ -111,13 +114,14 @@ Consulta el documento [README](../README.md) para la preparación. ```text Me gustaría construir una imagen de contenedor de una aplicación .NET. Sigue las instrucciones a continuación. + - Identifica primero todos los pasos que vas a hacer. - La aplicación .NET se encuentra en `dotnet`. - Tu directorio de trabajo es la raíz del repositorio. - - Identifica primero todos los pasos que vas a hacer. - Crea un Dockerfile, `Dockerfile.dotnet`. - Usa .NET 9. - Usa el enfoque de construcción multi-etapa. - Usa el número de puerto objetivo `8080` para la imagen del contenedor. + - Agrega la variable de entorno, `ApiSettings__BaseUrl` al contenedor. Debe apuntar a la aplicación Java, `http://localhost:8080/api`. ``` 1. Haz clic en el botón ![imagen del botón keep](https://img.shields.io/badge/keep-blue) de GitHub Copilot para tomar los cambios. @@ -141,12 +145,13 @@ Consulta el documento [README](../README.md) para la preparación. Usa la imagen del contenedor recién construida, ejecuta un contenedor y verifica si la aplicación se está ejecutando correctamente. - Usa el puerto del host `3030`. + - Pasa la variable de entorno `ApiSettings__BaseUrl` el valor de `http://localhost:8080/api`. ``` 1. Asegúrate de que tanto las aplicaciones frontend como backend NO se estén comunicando entre sí porque aún no se conocen. Ejecuta el prompt como el siguiente. ```text - Independientemente o no, remueve ambos contenedores que están ejecutándose actualmente. + Remueve ambos contenedores Java y .NET y sus respectivas imágenes de contenedor. ``` ### Orquestar Contenedores @@ -157,6 +162,7 @@ Consulta el documento [README](../README.md) para la preparación. ```text Me gustaría crear un archivo Docker Compose. Sigue las instrucciones a continuación. + - Identifica primero todos los pasos que vas a hacer. - Tu directorio de trabajo es la raíz del repositorio. - Usa `Dockerfile.java` como aplicación backend. - Usa `Dockerfile.dotnet` como aplicación frontend. @@ -164,7 +170,8 @@ Consulta el documento [README](../README.md) para la preparación. - Usa `contoso` como el nombre de la red. - Usa `contoso-backend` como el nombre del contenedor de la aplicación Java. Su puerto objetivo es 8080, y el puerto del host es 8080. - Usa `contoso-frontend` como el nombre del contenedor de la aplicación .NET. Su puerto objetivo es 8080, y el puerto del host es 3030. - - Monta el volumen para la base de datos que usa la aplicación Java, `java/socialapp/sns_api.db`. + - Agrega ambas variables de entorno, `CODESPACE_NAME` y `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` del host al contenedor Java. + - Agrega la variable de entorno, `ApiSettings__BaseUrl` al contenedor .NET. Debe apuntar al `/api` de la aplicación Java. ``` 1. Haz clic en el botón ![imagen del botón keep](https://img.shields.io/badge/keep-blue) de GitHub Copilot para tomar los cambios. @@ -172,7 +179,7 @@ Consulta el documento [README](../README.md) para la preparación. 1. Una vez que el archivo `compose.yaml` esté creado, ejecútalo y verifica si ambas aplicaciones se están ejecutando correctamente. ```text - Ahora, ejecuta el archivo Docker compose y verifica si las aplicaciones se están ejecutando correctamente. + Ejecuta el archivo Docker compose y verifica si todas las aplicaciones se están ejecutando correctamente. ``` 1. Abre un navegador web y navega a `http://localhost:3030`, y verifica si las aplicaciones están funcionando correctamente. diff --git a/localisation/fr-fr/README.md b/localisation/fr-fr/README.md index aff1c49..850725c 100644 --- a/localisation/fr-fr/README.md +++ b/localisation/fr-fr/README.md @@ -1,6 +1,6 @@ # Atelier de Codage Vibe GitHub Copilot -![GitHub Copilot - Ghiblifiled](../../images/ghcp.jpg) +![Atelier de Codage Vibe GitHub Copilot](../../images/banner.png) Vibrons-codons avec [GitHub Copilot](https://docs.github.com/copilot/about-github-copilot/what-is-github-copilot) et ses fonctionnalités les plus récentes et les plus avancées dans divers langages de programmation tels que Python, JavaScript, Java et .NET, ainsi que pour rendre les applications cloud-natives par conteneurisation. Êtes-vous prêt à vous lancer ? diff --git a/localisation/fr-fr/complete/java/socialapp/README.md b/localisation/fr-fr/complete/java/README.md similarity index 100% rename from localisation/fr-fr/complete/java/socialapp/README.md rename to localisation/fr-fr/complete/java/README.md diff --git a/localisation/fr-fr/docs/00-setup.md b/localisation/fr-fr/docs/00-setup.md index ca738b1..848cd34 100644 --- a/localisation/fr-fr/docs/00-setup.md +++ b/localisation/fr-fr/docs/00-setup.md @@ -18,6 +18,7 @@ Consultez le document [README](../README.md) pour la préparation. - [Démarrer Visual Studio Code](#démarrer-visual-studio-code) - [Configurer les Serveurs MCP](#configurer-les-serveurs-mcp) - [Vérifier le Mode Agent GitHub Copilot](#vérifier-le-mode-agent-github-copilot) +- [Configurer le Mode Bête](#configurer-le-mode-bête) - [Préparer les Instructions Personnalisées](#préparer-les-instructions-personnalisées) - [Analyser le Document d'Exigences Produit (PRD) et Concevoir l'API](#analyser-le-document-dexigences-produit-prd-et-concevoir-lapi) @@ -256,6 +257,7 @@ Consultez le document [README](../README.md) pour la préparation. ### Configurer les Serveurs MCP +1. Assurez-vous que Docker Desktop est en cours d'exécution si vous utilisez VS Code sur votre machine locale. 1. Définissez la variable d'environnement de `$REPOSITORY_ROOT`. ```bash @@ -284,6 +286,7 @@ Consultez le document [README](../README.md) pour la préparation. 1. Ouvrez la Palette de Commandes en tapant F1 ou `Ctrl`+`Shift`+`P` sur Windows ou `Cmd`+`Shift`+`P` sur Mac OS, et recherchez `MCP: List Servers`. 1. Choisissez `context7` puis cliquez sur `Start Server`. +1. Choisissez `awesome-copilot` puis cliquez sur `Start Server`. ## Vérifier le Mode Agent GitHub Copilot @@ -298,6 +301,40 @@ Consultez le document [README](../README.md) pour la préparation. 1. Sélectionnez le modèle soit `GPT-4.1` soit `Claude Sonnet 4`. +## Configurer le Mode Bête + +1. Entrez `/mcp.awesome-copilot.get_search_prompt`, suivi de mots-clés comme "beast mode" + + Cela devrait afficher la liste des modes de chat bête. Entrez un prompt similaire à `4.1 Beast Chat Mode`. Ensuite, il sera sauvegardé sous le répertoire `.github/chatmodes`. + +1. Choisissez le mode `4.1-Beast` au lieu du mode `Agent`. Il changera automatiquement le LLM vers `GPT 4.1`. + +1. Définissez la variable d'environnement de `$REPOSITORY_ROOT`. + + ```bash + # bash/zsh + REPOSITORY_ROOT=$(git rev-parse --show-toplevel) + ``` + + ```powershell + # PowerShell + $REPOSITORY_ROOT = git rev-parse --show-toplevel + ``` + +1. Copiez les paramètres de l'espace de travail. + + ```bash + # bash/zsh + cp $REPOSITORY_ROOT/docs/.vscode/settings.json \ + $REPOSITORY_ROOT/.vscode/settings.json + ``` + + ```powershell + # PowerShell + Copy-Item -Path $REPOSITORY_ROOT/docs/.vscode/settings.json ` + -Destination $REPOSITORY_ROOT/.vscode/settings.json -Force + ``` + ## Préparer les Instructions Personnalisées 1. Définissez la variable d'environnement de `$REPOSITORY_ROOT`. diff --git a/localisation/fr-fr/docs/05-containerization.md b/localisation/fr-fr/docs/05-containerization.md index b8a3a04..f2a21f4 100644 --- a/localisation/fr-fr/docs/05-containerization.md +++ b/localisation/fr-fr/docs/05-containerization.md @@ -70,14 +70,16 @@ Consultez le document [README](../README.md) pour la préparation. ```text J'aimerais construire une image conteneur d'une application Java. Suivez les instructions ci-dessous. - - L'application Java se trouve dans `java`. - - Votre répertoire de travail est la racine du dépôt. - Identifiez d'abord toutes les étapes que vous allez effectuer. + - L'application Java se trouve dans `java/socialapp`. + - Votre répertoire de travail est la racine du dépôt. - Créez un Dockerfile, `Dockerfile.java`. - Utilisez Microsoft OpenJDK 21. - Utilisez l'approche de construction multi-étapes. - Extrayez JRE de JDK. - Utilisez le numéro de port cible `8080` pour l'image conteneur. + - Ajoutez les deux variables d'environnement, `CODESPACE_NAME` et `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` de l'hôte à l'image conteneur. + - Créez un fichier de base de données SQLite, `sns_api.db`, dans l'image conteneur. NE copiez PAS le fichier de l'hôte. ``` 1. Cliquez sur le bouton ![l'image du bouton keep](https://img.shields.io/badge/keep-blue) de GitHub Copilot pour prendre les modifications. @@ -101,6 +103,7 @@ Consultez le document [README](../README.md) pour la préparation. Utilisez l'image conteneur qui vient d'être construite, exécutez un conteneur et vérifiez si l'application fonctionne correctement. - Utilisez le port hôte `8080`. + - Les deux valeurs `CODESPACE_NAME` et `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` doivent être celles de GitHub Codespaces. ``` ### Conteneuriser l'Application .NET @@ -111,13 +114,14 @@ Consultez le document [README](../README.md) pour la préparation. ```text J'aimerais construire une image conteneur d'une application .NET. Suivez les instructions ci-dessous. + - Identifiez d'abord toutes les étapes que vous allez effectuer. - L'application .NET se trouve dans `dotnet`. - Votre répertoire de travail est la racine du dépôt. - - Identifiez d'abord toutes les étapes que vous allez effectuer. - Créez un Dockerfile, `Dockerfile.dotnet`. - Utilisez .NET 9. - Utilisez l'approche de construction multi-étapes. - Utilisez le numéro de port cible `8080` pour l'image conteneur. + - Ajoutez la variable d'environnement, `ApiSettings__BaseUrl` au conteneur. Elle doit pointer vers l'application Java, `http://localhost:8080/api`. ``` 1. Cliquez sur le bouton ![l'image du bouton keep](https://img.shields.io/badge/keep-blue) de GitHub Copilot pour prendre les modifications. @@ -141,12 +145,13 @@ Consultez le document [README](../README.md) pour la préparation. Utilisez l'image conteneur qui vient d'être construite, exécutez un conteneur et vérifiez si l'application fonctionne correctement. - Utilisez le port hôte `3030`. + - Passez la variable d'environnement `ApiSettings__BaseUrl` la valeur de `http://localhost:8080/api`. ``` 1. Assurez-vous que les applications frontend et backend ne communiquent PAS entre elles car elles ne se connaissent pas encore. Exécutez l'invite comme ci-dessous. ```text - Peu importe ou non, supprimez les deux conteneurs actuellement en cours d'exécution. + Supprimez les deux conteneurs Java et .NET et leurs images conteneur respectives. ``` ### Orchestrer les Conteneurs @@ -157,6 +162,7 @@ Consultez le document [README](../README.md) pour la préparation. ```text J'aimerais créer un fichier Docker Compose. Suivez les instructions ci-dessous. + - Identifiez d'abord toutes les étapes que vous allez effectuer. - Votre répertoire de travail est la racine du dépôt. - Utilisez `Dockerfile.java` comme application backend. - Utilisez `Dockerfile.dotnet` comme application frontend. @@ -164,7 +170,8 @@ Consultez le document [README](../README.md) pour la préparation. - Utilisez `contoso` comme nom de réseau. - Utilisez `contoso-backend` comme nom de conteneur de l'application Java. Son port cible est 8080, et le port hôte est 8080. - Utilisez `contoso-frontend` comme nom de conteneur de l'application .NET. Son port cible est 8080, et le port hôte est 3030. - - Montez le volume pour la base de données que l'application Java utilise, `java/socialapp/sns_api.db`. + - Ajoutez les deux variables d'environnement, `CODESPACE_NAME` et `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` de l'hôte au conteneur Java. + - Ajoutez la variable d'environnement, `ApiSettings__BaseUrl` au conteneur .NET. Elle doit pointer vers le `/api` de l'application Java. ``` 1. Cliquez sur le bouton ![l'image du bouton keep](https://img.shields.io/badge/keep-blue) de GitHub Copilot pour prendre les modifications. @@ -172,7 +179,7 @@ Consultez le document [README](../README.md) pour la préparation. 1. Une fois le fichier `compose.yaml` créé, exécutez-le et vérifiez si les deux applications fonctionnent correctement. ```text - Maintenant, exécutez le fichier Docker compose et vérifiez si les applications fonctionnent correctement. + Exécutez le fichier Docker compose et vérifiez si toutes les applications fonctionnent correctement. ``` 1. Ouvrez un navigateur web et naviguez vers `http://localhost:3030`, et vérifiez si les applications sont en marche et fonctionnent correctement. diff --git a/localisation/ja-jp/README.md b/localisation/ja-jp/README.md index 543b900..9a66112 100644 --- a/localisation/ja-jp/README.md +++ b/localisation/ja-jp/README.md @@ -1,6 +1,6 @@ # GitHub Copilot Vibe コーディングワークショップ -![GitHub Copilot - Ghiblifiled](../../images/ghcp.jpg) +![GitHub Copilot Vibe コーディングワークショップ](../../images/banner.png) Python、JavaScript、Java、.NETなど様々なプログラミング言語で[GitHub Copilot](https://docs.github.com/copilot/about-github-copilot/what-is-github-copilot)と最新かつ最高の機能を使ってバイブコーディングを行い、コンテナ化によってアプリをクラウドネイティブにしましょう。飛び込む準備はできていますか? diff --git a/localisation/ja-jp/complete/java/socialapp/README.md b/localisation/ja-jp/complete/java/README.md similarity index 100% rename from localisation/ja-jp/complete/java/socialapp/README.md rename to localisation/ja-jp/complete/java/README.md diff --git a/localisation/ja-jp/docs/00-setup.md b/localisation/ja-jp/docs/00-setup.md index e69df6a..317fd61 100644 --- a/localisation/ja-jp/docs/00-setup.md +++ b/localisation/ja-jp/docs/00-setup.md @@ -18,6 +18,7 @@ - [Visual Studio Code を起動](#visual-studio-code-を起動) - [MCP サーバーを設定](#mcp-サーバーを設定) - [GitHub Copilot エージェントモードを確認](#github-copilot-エージェントモードを確認) +- [ビーストモードを設定](#ビーストモードを設定) - [カスタム指示を準備](#カスタム指示を準備) - [製品要求仕様書(PRD)を分析してAPIを設計](#製品要求仕様書prdを分析してapiを設計) @@ -256,6 +257,7 @@ ### MCP サーバーを設定 +1. ローカルマシンでVS Codeを使用している場合は、Docker Desktopが起動していることを確認してください。 1. `$REPOSITORY_ROOT` 環境変数を設定します。 ```bash @@ -284,6 +286,7 @@ 1. F1 キーまたは Windows では `Ctrl`+`Shift`+`P`、Mac OS では `Cmd`+`Shift`+`P` を入力してコマンドパレットを開き、`MCP: List Servers` を検索します。 1. `context7` を選択して `Start Server` をクリックします。 +1. `awesome-copilot` を選択して `Start Server` をクリックします。 ## GitHub Copilot エージェントモードを確認 @@ -298,6 +301,40 @@ 1. モデルを `GPT-4.1` または `Claude Sonnet 4` のいずれかに選択します。 +## ビーストモードを設定 + +1. `/mcp.awesome-copilot.get_search_prompt` を入力し、続いて "beast mode" のようなキーワードを入力します + + ビーストチャットモードのリストが表示されます。`4.1 Beast Chat Mode` のようなプロンプトを入力します。すると、`.github/chatmodes` ディレクトリに保存されます。 + +1. `Agent` モードの代わりに `4.1-Beast` モードを選択します。自動的にLLMが `GPT 4.1` に変更されます。 + +1. `$REPOSITORY_ROOT` 環境変数を設定します。 + + ```bash + # bash/zsh + REPOSITORY_ROOT=$(git rev-parse --show-toplevel) + ``` + + ```powershell + # PowerShell + $REPOSITORY_ROOT = git rev-parse --show-toplevel + ``` + +1. ワークスペース設定をコピーします。 + + ```bash + # bash/zsh + cp $REPOSITORY_ROOT/docs/.vscode/settings.json \ + $REPOSITORY_ROOT/.vscode/settings.json + ``` + + ```powershell + # PowerShell + Copy-Item -Path $REPOSITORY_ROOT/docs/.vscode/settings.json ` + -Destination $REPOSITORY_ROOT/.vscode/settings.json -Force + ``` + ## カスタム指示を準備 1. `$REPOSITORY_ROOT` 環境変数を設定します。 diff --git a/localisation/ja-jp/docs/05-containerization.md b/localisation/ja-jp/docs/05-containerization.md index 260ec9b..139a3c4 100644 --- a/localisation/ja-jp/docs/05-containerization.md +++ b/localisation/ja-jp/docs/05-containerization.md @@ -70,14 +70,16 @@ DevOpsエンジニアとして、両方のアプリをコンテナ化する必 ```text Javaアプリのコンテナイメージを構築したいと思います。以下の指示に従ってください。 - - Javaアプリは `java` にあります。 - - 作業ディレクトリはリポジトリルートです。 - まず実行するすべてのステップを特定してください。 + - Javaアプリは `java/socialapp` にあります。 + - 作業ディレクトリはリポジトリルートです。 - Dockerfile `Dockerfile.java` を作成してください。 - Microsoft OpenJDK 21を使用してください。 - マルチステージビルドアプローチを使用してください。 - JDKからJREを抽出してください。 - コンテナイメージのターゲットポート番号として `8080` を使用してください。 + - ホストからコンテナイメージに環境変数 `CODESPACE_NAME` と `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` の両方を追加してください。 + - コンテナイメージにSQLiteデータベースファイル `sns_api.db` を作成してください。ホストからファイルをコピーしないでください。 ``` 1. GitHub Copilot の ![keepボタンの画像](https://img.shields.io/badge/keep-blue) ボタンをクリックして変更を適用します。 @@ -101,6 +103,7 @@ DevOpsエンジニアとして、両方のアプリをコンテナ化する必 構築したばかりのコンテナイメージを使用して、コンテナを実行し、アプリが適切に実行されているかどうかを確認してください。 - ホストポートとして `8080` を使用してください。 + - `CODESPACE_NAME` と `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` の両方の値は GitHub Codespaces のものである必要があります。 ``` ### .NET アプリケーションをコンテナ化 @@ -111,13 +114,14 @@ DevOpsエンジニアとして、両方のアプリをコンテナ化する必 ```text .NETアプリのコンテナイメージを構築したいと思います。以下の指示に従ってください。 + - まず実行するすべてのステップを特定してください。 - .NETアプリは `dotnet` にあります。 - 作業ディレクトリはリポジトリルートです。 - - まず実行するすべてのステップを特定してください。 - Dockerfile `Dockerfile.dotnet` を作成してください。 - .NET 9を使用してください。 - マルチステージビルドアプローチを使用してください。 - コンテナイメージのターゲットポート番号として `8080` を使用してください。 + - コンテナに環境変数 `ApiSettings__BaseUrl` を追加してください。これはJavaアプリの `http://localhost:8080/api` を指すようにしてください。 ``` 1. GitHub Copilot の ![keepボタンの画像](https://img.shields.io/badge/keep-blue) ボタンをクリックして変更を適用します。 @@ -141,12 +145,13 @@ DevOpsエンジニアとして、両方のアプリをコンテナ化する必 構築したばかりのコンテナイメージを使用して、コンテナを実行し、アプリが適切に実行されているかどうかを確認してください。 - ホストポートとして `3030` を使用してください。 + - 環境変数 `ApiSettings__BaseUrl` に `http://localhost:8080/api` の値を渡してください。 ``` 1. フロントエンドとバックエンドの両方のアプリが、まだ互いを知らないため通信していないことを確認します。以下のようなプロンプトを実行します。 ```text - いずれにせよ、現在実行中の両方のコンテナを削除してください。 + JavaとNETの両方のコンテナとそれぞれのコンテナイメージを削除してください。 ``` ### コンテナをオーケストレート @@ -157,6 +162,7 @@ DevOpsエンジニアとして、両方のアプリをコンテナ化する必 ```text Docker Composeファイルを作成したいと思います。以下の指示に従ってください。 + - まず実行するすべてのステップを特定してください。 - 作業ディレクトリはリポジトリルートです。 - バックエンドアプリとして `Dockerfile.java` を使用してください。 - フロントエンドアプリとして `Dockerfile.dotnet` を使用してください。 @@ -164,7 +170,8 @@ DevOpsエンジニアとして、両方のアプリをコンテナ化する必 - ネットワーク名として `contoso` を使用してください。 - Javaアプリのコンテナ名として `contoso-backend` を使用してください。ターゲットポートは8080、ホストポートは8080です。 - .NETアプリのコンテナ名として `contoso-frontend` を使用してください。ターゲットポートは8080、ホストポートは3030です。 - - Javaアプリが使用するデータベース `java/socialapp/sns_api.db` のボリュームをマウントしてください。 + - ホストからJavaコンテナに環境変数 `CODESPACE_NAME` と `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` の両方を追加してください。 + - .NETコンテナに環境変数 `ApiSettings__BaseUrl` を追加してください。これはJavaアプリの `/api` を指すようにしてください。 ``` 1. GitHub Copilot の ![keepボタンの画像](https://img.shields.io/badge/keep-blue) ボタンをクリックして変更を適用します。 @@ -172,7 +179,7 @@ DevOpsエンジニアとして、両方のアプリをコンテナ化する必 1. `compose.yaml` ファイルが作成されたら、それを実行して両方のアプリが適切に実行されているかどうかを確認します。 ```text - Docker composeファイルを実行して、アプリが適切に実行されているかどうかを確認してください。 + Docker composeファイルを実行して、すべてのアプリが適切に実行されているかどうかを確認してください。 ``` 1. ウェブブラウザを開いて `http://localhost:3030` に移動し、アプリが適切に起動して実行されているかどうかを確認します。 diff --git a/localisation/ko-kr/README.md b/localisation/ko-kr/README.md index 07ee889..c524ff7 100644 --- a/localisation/ko-kr/README.md +++ b/localisation/ko-kr/README.md @@ -1,6 +1,6 @@ # GitHub Copilot Vibe 코딩 워크샵 -![GitHub Copilot - Ghiblifiled](../../images/ghcp.jpg) +![GitHub Copilot Vibe 코딩 워크샵](../../images/banner.png) Python, JavaScript, Java, .NET 등 다양한 프로그래밍 언어에서 [GitHub Copilot](https://docs.github.com/copilot/about-github-copilot/what-is-github-copilot)과 최신 기능들로 바이브 코딩을 하고, 컨테이너화를 통해 앱을 클라우드 네이티브로 만들어 보세요. 뛰어들 준비가 되셨나요? diff --git a/localisation/ko-kr/complete/java/socialapp/README.md b/localisation/ko-kr/complete/java/README.md similarity index 100% rename from localisation/ko-kr/complete/java/socialapp/README.md rename to localisation/ko-kr/complete/java/README.md diff --git a/localisation/ko-kr/docs/00-setup.md b/localisation/ko-kr/docs/00-setup.md index 65303d1..c429659 100644 --- a/localisation/ko-kr/docs/00-setup.md +++ b/localisation/ko-kr/docs/00-setup.md @@ -18,6 +18,7 @@ - [Visual Studio Code 시작](#visual-studio-code-시작) - [MCP 서버 설정](#mcp-서버-설정) - [GitHub Copilot 에이전트 모드 확인](#github-copilot-에이전트-모드-확인) +- [비스트 모드 구성](#비스트-모드-구성) - [커스텀 지시사항 준비](#커스텀-지시사항-준비) - [제품 요구사항 문서(PRD) 분석 및 API 설계](#제품-요구사항-문서prd-분석-및-api-설계) @@ -256,6 +257,7 @@ ### MCP 서버 설정 +1. 로컬 머신에서 VS Code를 사용하는 경우 Docker Desktop이 실행 중인지 확인하세요. 1. `$REPOSITORY_ROOT` 환경 변수를 설정하세요. ```bash @@ -284,6 +286,7 @@ 1. F1을 입력하거나 Windows에서 `Ctrl`+`Shift`+`P`, Mac OS에서 `Cmd`+`Shift`+`P`를 눌러 명령 팔레트를 열고 `MCP: List Servers`를 검색하세요. 1. `context7`을 선택한 다음 `Start Server`를 클릭하세요. +1. `awesome-copilot`을 선택한 다음 `Start Server`를 클릭하세요. ## GitHub Copilot 에이전트 모드 확인 @@ -298,6 +301,40 @@ 1. 모델을 `GPT-4.1` 또는 `Claude Sonnet 4` 중 하나로 선택하세요. +## 비스트 모드 구성 + +1. `/mcp.awesome-copilot.get_search_prompt`를 입력한 후 "beast mode"와 같은 키워드를 입력하세요 + + 비스트 채팅 모드 목록이 표시됩니다. `4.1 Beast Chat Mode`와 유사한 프롬프트를 입력하세요. 그러면 `.github/chatmodes` 디렉토리에 저장됩니다. + +1. `Agent` 모드 대신 `4.1-Beast` 모드를 선택하세요. 자동으로 LLM이 `GPT 4.1`로 변경됩니다. + +1. `$REPOSITORY_ROOT` 환경 변수를 설정하세요. + + ```bash + # bash/zsh + REPOSITORY_ROOT=$(git rev-parse --show-toplevel) + ``` + + ```powershell + # PowerShell + $REPOSITORY_ROOT = git rev-parse --show-toplevel + ``` + +1. 워크스페이스 설정을 복사하세요. + + ```bash + # bash/zsh + cp $REPOSITORY_ROOT/docs/.vscode/settings.json \ + $REPOSITORY_ROOT/.vscode/settings.json + ``` + + ```powershell + # PowerShell + Copy-Item -Path $REPOSITORY_ROOT/docs/.vscode/settings.json ` + -Destination $REPOSITORY_ROOT/.vscode/settings.json -Force + ``` + ## 커스텀 지시사항 준비 1. `$REPOSITORY_ROOT` 환경 변수를 설정하세요. diff --git a/localisation/ko-kr/docs/05-containerization.md b/localisation/ko-kr/docs/05-containerization.md index 14960d3..cd34b9e 100644 --- a/localisation/ko-kr/docs/05-containerization.md +++ b/localisation/ko-kr/docs/05-containerization.md @@ -70,14 +70,16 @@ Contoso는 다양한 야외 활동 제품을 판매하는 회사입니다. Conto ```text Java 앱의 컨테이너 이미지를 빌드하고 싶습니다. 아래 지침을 따르세요. - - Java 앱은 `java`에 위치합니다. - - 작업 디렉토리는 저장소 루트입니다. - 먼저 수행할 모든 단계를 식별하세요. + - Java 앱은 `java/socialapp`에 위치합니다. + - 작업 디렉토리는 저장소 루트입니다. - `Dockerfile.java` Dockerfile을 생성하세요. - Microsoft OpenJDK 21을 사용하세요. - 멀티 스테이지 빌드 방식을 사용하세요. - JDK에서 JRE를 추출하세요. - 컨테이너 이미지의 대상 포트 번호로 `8080`을 사용하세요. + - 호스트에서 컨테이너 이미지로 환경 변수 `CODESPACE_NAME`과 `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` 모두를 추가하세요. + - 컨테이너 이미지에 SQLite 데이터베이스 파일 `sns_api.db`를 생성하세요. 호스트에서 파일을 복사하지 마세요. ``` 1. GitHub Copilot의 ![the keep button image](https://img.shields.io/badge/keep-blue) 버튼을 클릭하여 변경사항을 적용하세요. @@ -101,6 +103,7 @@ Contoso는 다양한 야외 활동 제품을 판매하는 회사입니다. Conto 방금 빌드한 컨테이너 이미지를 사용하여 컨테이너를 실행하고 앱이 제대로 실행되는지 확인하세요. - 호스트 포트로 `8080`을 사용하세요. + - `CODESPACE_NAME`과 `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` 값 모두 GitHub Codespaces의 값이어야 합니다. ``` ### .NET 애플리케이션 컨테이너화 @@ -111,13 +114,14 @@ Contoso는 다양한 야외 활동 제품을 판매하는 회사입니다. Conto ```text .NET 앱의 컨테이너 이미지를 빌드하고 싶습니다. 아래 지침을 따르세요. + - 먼저 수행할 모든 단계를 식별하세요. - .NET 앱은 `dotnet`에 위치합니다. - 작업 디렉토리는 저장소 루트입니다. - - 먼저 수행할 모든 단계를 식별하세요. - `Dockerfile.dotnet` Dockerfile을 생성하세요. - .NET 9를 사용하세요. - 멀티 스테이지 빌드 방식을 사용하세요. - 컨테이너 이미지의 대상 포트 번호로 `8080`을 사용하세요. + - 컨테이너에 환경 변수 `ApiSettings__BaseUrl`을 추가하세요. 이는 Java 앱 `http://localhost:8080/api`를 가리켜야 합니다. ``` 1. GitHub Copilot의 ![the keep button image](https://img.shields.io/badge/keep-blue) 버튼을 클릭하여 변경사항을 적용하세요. @@ -141,12 +145,13 @@ Contoso는 다양한 야외 활동 제품을 판매하는 회사입니다. Conto 방금 빌드한 컨테이너 이미지를 사용하여 컨테이너를 실행하고 앱이 제대로 실행되는지 확인하세요. - 호스트 포트로 `3030`을 사용하세요. + - 환경 변수 `ApiSettings__BaseUrl`에 `http://localhost:8080/api` 값을 전달하세요. ``` 1. 프론트엔드와 백엔드 앱이 서로를 알지 못하므로 아직 통신하지 않는지 확인하세요. 아래와 같은 프롬프트를 실행하세요. ```text - 상관없이 현재 실행 중인 두 컨테이너를 모두 제거하세요. + Java와 .NET 컨테이너 모두와 각각의 컨테이너 이미지를 제거하세요. ``` ### 컨테이너 오케스트레이션 @@ -157,6 +162,7 @@ Contoso는 다양한 야외 활동 제품을 판매하는 회사입니다. Conto ```text Docker Compose 파일을 생성하고 싶습니다. 아래 지침을 따르세요. + - 먼저 수행할 모든 단계를 식별하세요. - 작업 디렉토리는 저장소 루트입니다. - 백엔드 앱으로 `Dockerfile.java`를 사용하세요. - 프론트엔드 앱으로 `Dockerfile.dotnet`을 사용하세요. @@ -164,7 +170,8 @@ Contoso는 다양한 야외 활동 제품을 판매하는 회사입니다. Conto - 네트워크 이름으로 `contoso`를 사용하세요. - Java 앱의 컨테이너 이름으로 `contoso-backend`를 사용하세요. 대상 포트는 8080이고 호스트 포트는 8080입니다. - .NET 앱의 컨테이너 이름으로 `contoso-frontend`를 사용하세요. 대상 포트는 8080이고 호스트 포트는 3030입니다. - - Java 앱이 사용하는 데이터베이스 `java/socialapp/sns_api.db`의 볼륨을 마운트하세요. + - 호스트에서 Java 컨테이너로 환경 변수 `CODESPACE_NAME`과 `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` 모두를 추가하세요. + - .NET 컨테이너에 환경 변수 `ApiSettings__BaseUrl`을 추가하세요. 이는 Java 앱의 `/api`를 가리켜야 합니다. ``` 1. GitHub Copilot의 ![the keep button image](https://img.shields.io/badge/keep-blue) 버튼을 클릭하여 변경사항을 적용하세요. @@ -172,7 +179,7 @@ Contoso는 다양한 야외 활동 제품을 판매하는 회사입니다. Conto 1. `compose.yaml` 파일이 생성되면, 실행하고 두 앱이 모두 제대로 실행되는지 확인하세요. ```text - 이제 Docker compose 파일을 실행하고 앱들이 제대로 실행되는지 확인하세요. + Docker compose 파일을 실행하고 모든 앱들이 제대로 실행되는지 확인하세요. ``` 1. 웹 브라우저를 열고 `http://localhost:3030`으로 이동하여, 앱이 제대로 실행되고 있는지 확인하세요. diff --git a/localisation/pt-br/README.md b/localisation/pt-br/README.md index 203567f..18dd225 100644 --- a/localisation/pt-br/README.md +++ b/localisation/pt-br/README.md @@ -1,6 +1,6 @@ # Workshop de Codificação GitHub Copilot Vibe -![GitHub Copilot - Ghiblifiled](../../images/ghcp.jpg) +![Workshop de Codificação GitHub Copilot Vibe](../../images/banner.png) Vamos codar com vibe usando o [GitHub Copilot](https://docs.github.com/copilot/about-github-copilot/what-is-github-copilot) e seus recursos mais novos e incríveis em várias linguagens de programação como Python, JavaScript, Java e .NET, além de tornar os aplicativos nativos da nuvem através da containerização. Você está pronto para mergulhar? diff --git a/localisation/pt-br/complete/java/socialapp/README.md b/localisation/pt-br/complete/java/README.md similarity index 100% rename from localisation/pt-br/complete/java/socialapp/README.md rename to localisation/pt-br/complete/java/README.md diff --git a/localisation/pt-br/docs/00-setup.md b/localisation/pt-br/docs/00-setup.md index 0f66997..4ca836b 100644 --- a/localisation/pt-br/docs/00-setup.md +++ b/localisation/pt-br/docs/00-setup.md @@ -18,6 +18,7 @@ Consulte a documentação [README](../README.md) para preparação. - [Iniciar Visual Studio Code](#iniciar-visual-studio-code) - [Configurar Servidores MCP](#configurar-servidores-mcp) - [Verificar o Modo Agente do GitHub Copilot](#verificar-o-modo-agente-do-github-copilot) +- [Configurar Modo Fera](#configurar-modo-fera) - [Preparar Instruções Customizadas](#preparar-instruções-customizadas) - [Analisar Documento de Requisitos do Produto (PRD) e Projetar API](#analisar-documento-de-requisitos-do-produto-prd-e-projetar-api) @@ -256,6 +257,7 @@ Consulte a documentação [README](../README.md) para preparação. ### Configurar Servidores MCP +1. Certifique-se de que o Docker Desktop esteja em execução se você usar o VS Code em sua máquina local. 1. Defina a variável de ambiente `$REPOSITORY_ROOT`. ```bash @@ -284,6 +286,7 @@ Consulte a documentação [README](../README.md) para preparação. 1. Abra a Paleta de Comandos digitando F1 ou `Ctrl`+`Shift`+`P` no Windows ou `Cmd`+`Shift`+`P` no Mac OS, e procure `MCP: List Servers`. 1. Escolha `context7` e clique em `Start Server`. +1. Escolha `awesome-copilot` e clique em `Start Server`. ## Verificar o Modo Agente do GitHub Copilot @@ -298,6 +301,40 @@ Consulte a documentação [README](../README.md) para preparação. 1. Selecione o modelo para `GPT-4.1` ou `Claude Sonnet 4`. +## Configurar Modo Fera + +1. Digite `/mcp.awesome-copilot.get_search_prompt`, seguido de palavras-chave como "beast mode" + + Isso deve mostrar a lista de modos de chat fera. Digite um prompt similar a `4.1 Beast Chat Mode`. Em seguida, será salvo no diretório `.github/chatmodes`. + +1. Escolha o modo `4.1-Beast` em vez do modo `Agent`. Ele mudará automaticamente o LLM para `GPT 4.1`. + +1. Defina a variável de ambiente `$REPOSITORY_ROOT`. + + ```bash + # bash/zsh + REPOSITORY_ROOT=$(git rev-parse --show-toplevel) + ``` + + ```powershell + # PowerShell + $REPOSITORY_ROOT = git rev-parse --show-toplevel + ``` + +1. Copie as configurações do workspace. + + ```bash + # bash/zsh + cp $REPOSITORY_ROOT/docs/.vscode/settings.json \ + $REPOSITORY_ROOT/.vscode/settings.json + ``` + + ```powershell + # PowerShell + Copy-Item -Path $REPOSITORY_ROOT/docs/.vscode/settings.json ` + -Destination $REPOSITORY_ROOT/.vscode/settings.json -Force + ``` + ## Preparar Instruções Customizadas 1. Defina a variável de ambiente `$REPOSITORY_ROOT`. diff --git a/localisation/pt-br/docs/05-containerization.md b/localisation/pt-br/docs/05-containerization.md index dca32ef..d3747b7 100644 --- a/localisation/pt-br/docs/05-containerization.md +++ b/localisation/pt-br/docs/05-containerization.md @@ -70,14 +70,16 @@ Consulte a documentação [README](../README.md) para preparação. ```text Gostaria de construir uma imagem de contêiner de uma aplicação Java. Siga as instruções abaixo. - - A aplicação Java está localizada em `java`. - - Seu diretório de trabalho é a raiz do repositório. - Identifique todos os passos primeiro, que você vai fazer. + - A aplicação Java está localizada em `java/socialapp`. + - Seu diretório de trabalho é a raiz do repositório. - Crie um Dockerfile, `Dockerfile.java`. - Use Microsoft OpenJDK 21. - Use abordagem de construção multi-estágio. - Extraia JRE do JDK. - Use o número da porta de destino `8080` para a imagem do contêiner. + - Adicione ambas as variáveis de ambiente, `CODESPACE_NAME` e `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` do host para a imagem do contêiner. + - Crie um arquivo de banco de dados SQLite, `sns_api.db`, na imagem do contêiner. NÃO copie o arquivo do host. ``` 1. Clique no botão ![a imagem do botão keep](https://img.shields.io/badge/keep-blue) do GitHub Copilot para aceitar as mudanças. @@ -101,6 +103,7 @@ Consulte a documentação [README](../README.md) para preparação. Use a imagem do contêiner recém-construída, execute um contêiner e verifique se a aplicação está funcionando adequadamente. - Use a porta do host `8080`. + - Ambos os valores `CODESPACE_NAME` e `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` devem ser aqueles do GitHub Codespaces. ``` ### Containerizar Aplicação .NET @@ -111,13 +114,14 @@ Consulte a documentação [README](../README.md) para preparação. ```text Gostaria de construir uma imagem de contêiner de uma aplicação .NET. Siga as instruções abaixo. + - Identifique todos os passos primeiro, que você vai fazer. - A aplicação .NET está localizada em `dotnet`. - Seu diretório de trabalho é a raiz do repositório. - - Identifique todos os passos primeiro, que você vai fazer. - Crie um Dockerfile, `Dockerfile.dotnet`. - Use .NET 9. - Use abordagem de construção multi-estágio. - Use o número da porta de destino `8080` para a imagem do contêiner. + - Adicione a variável de ambiente, `ApiSettings__BaseUrl` ao contêiner. Deve apontar para a aplicação Java, `http://localhost:8080/api`. ``` 1. Clique no botão ![a imagem do botão keep](https://img.shields.io/badge/keep-blue) do GitHub Copilot para aceitar as mudanças. @@ -141,12 +145,13 @@ Consulte a documentação [README](../README.md) para preparação. Use a imagem do contêiner recém-construída, execute um contêiner e verifique se a aplicação está funcionando adequadamente. - Use a porta do host `3030`. + - Passe a variável de ambiente `ApiSettings__BaseUrl` o valor de `http://localhost:8080/api`. ``` 1. Certifique-se de que ambas as aplicações frontend e backend NÃO estão se comunicando uma com a outra porque elas ainda não se conhecem. Execute o prompt como abaixo. ```text - Independentemente ou não, remova ambos os contêineres atualmente em execução. + Remova ambos os contêineres Java e .NET e suas respectivas imagens de contêiner. ``` ### Orquestrar Contêineres @@ -157,6 +162,7 @@ Consulte a documentação [README](../README.md) para preparação. ```text Gostaria de criar um arquivo Docker Compose. Siga as instruções abaixo. + - Identifique todos os passos primeiro, que você vai fazer. - Seu diretório de trabalho é a raiz do repositório. - Use `Dockerfile.java` como aplicação backend. - Use `Dockerfile.dotnet` como aplicação frontend. @@ -164,7 +170,8 @@ Consulte a documentação [README](../README.md) para preparação. - Use `contoso` como nome da rede. - Use `contoso-backend` como nome do contêiner da aplicação Java. Sua porta de destino é 8080, e porta do host é 8080. - Use `contoso-frontend` como nome do contêiner da aplicação .NET. Sua porta de destino é 8080, e porta do host é 3030. - - Monte o volume para o banco de dados que a aplicação Java usa, `java/socialapp/sns_api.db`. + - Adicione ambas as variáveis de ambiente, `CODESPACE_NAME` e `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` do host para o contêiner Java. + - Adicione a variável de ambiente, `ApiSettings__BaseUrl` ao contêiner .NET. Deve apontar para o `/api` da aplicação Java. ``` 1. Clique no botão ![a imagem do botão keep](https://img.shields.io/badge/keep-blue) do GitHub Copilot para aceitar as mudanças. @@ -172,7 +179,7 @@ Consulte a documentação [README](../README.md) para preparação. 1. Uma vez que o arquivo `compose.yaml` seja criado, execute-o e verifique se ambas as aplicações estão funcionando adequadamente. ```text - Agora, execute o arquivo Docker compose e verifique se as aplicações estão funcionando adequadamente. + Execute o arquivo Docker compose e verifique se todas as aplicações estão funcionando adequadamente. ``` 1. Abra um navegador web e navegue para `http://localhost:3030`, e verifique se as aplicações estão funcionando adequadamente. diff --git a/localisation/zh-cn/README.md b/localisation/zh-cn/README.md index 56d8911..21e5d15 100644 --- a/localisation/zh-cn/README.md +++ b/localisation/zh-cn/README.md @@ -1,6 +1,6 @@ # GitHub Copilot Vibe 编程工作坊 -![GitHub Copilot - Ghiblifiled](../../images/ghcp.jpg) +![GitHub Copilot Vibe 编程工作坊](../../images/banner.png) 让我们使用 [GitHub Copilot](https://docs.github.com/copilot/about-github-copilot/what-is-github-copilot) 及其在 Python、JavaScript、Java 和 .NET 等各种编程语言中的最新最强大功能进行氛围编程,并通过容器化让应用程序变得云原生。你准备好开始了吗? diff --git a/localisation/zh-cn/complete/java/socialapp/README.md b/localisation/zh-cn/complete/java/README.md similarity index 100% rename from localisation/zh-cn/complete/java/socialapp/README.md rename to localisation/zh-cn/complete/java/README.md diff --git a/localisation/zh-cn/docs/00-setup.md b/localisation/zh-cn/docs/00-setup.md index 01c9976..f1588c0 100644 --- a/localisation/zh-cn/docs/00-setup.md +++ b/localisation/zh-cn/docs/00-setup.md @@ -18,6 +18,7 @@ - [启动 Visual Studio Code](#启动-visual-studio-code) - [设置 MCP 服务器](#设置-mcp-服务器) - [检查 GitHub Copilot 代理模式](#检查-github-copilot-代理模式) +- [配置野兽模式](#配置野兽模式) - [准备自定义指令](#准备自定义指令) - [分析产品需求文档 (PRD) 和设计 API](#分析产品需求文档-prd-和设计-api) @@ -256,6 +257,7 @@ ### 设置 MCP 服务器 +1. 如果您在本地机器上使用 VS Code,请确保 Docker Desktop 正在运行。 1. 设置 `$REPOSITORY_ROOT` 环境变量。 ```bash @@ -284,6 +286,7 @@ 1. 通过按 F1 或在 Windows 上按 `Ctrl`+`Shift`+`P` 或在 Mac OS 上按 `Cmd`+`Shift`+`P` 打开命令面板,然后搜索 `MCP: List Servers`。 1. 选择 `context7` 然后点击 `Start Server`。 +1. 选择 `awesome-copilot` 然后点击 `Start Server`。 ## 检查 GitHub Copilot 代理模式 @@ -298,6 +301,40 @@ 1. 选择模型为 `GPT-4.1` 或 `Claude Sonnet 4`。 +## 配置野兽模式 + +1. 输入 `/mcp.awesome-copilot.get_search_prompt`,然后输入类似 "beast mode" 的关键词 + + 它应该显示野兽聊天模式列表。输入类似 `4.1 Beast Chat Mode` 的提示。然后它将保存在 `.github/chatmodes` 目录下。 + +1. 选择 `4.1-Beast` 模式而不是 `Agent` 模式。它将自动将 LLM 更改为 `GPT 4.1`。 + +1. 设置 `$REPOSITORY_ROOT` 环境变量。 + + ```bash + # bash/zsh + REPOSITORY_ROOT=$(git rev-parse --show-toplevel) + ``` + + ```powershell + # PowerShell + $REPOSITORY_ROOT = git rev-parse --show-toplevel + ``` + +1. 复制工作区设置。 + + ```bash + # bash/zsh + cp $REPOSITORY_ROOT/docs/.vscode/settings.json \ + $REPOSITORY_ROOT/.vscode/settings.json + ``` + + ```powershell + # PowerShell + Copy-Item -Path $REPOSITORY_ROOT/docs/.vscode/settings.json ` + -Destination $REPOSITORY_ROOT/.vscode/settings.json -Force + ``` + ## 准备自定义指令 1. 设置 `$REPOSITORY_ROOT` 环境变量。 diff --git a/localisation/zh-cn/docs/05-containerization.md b/localisation/zh-cn/docs/05-containerization.md index 9b7fb14..8b94c93 100644 --- a/localisation/zh-cn/docs/05-containerization.md +++ b/localisation/zh-cn/docs/05-containerization.md @@ -70,14 +70,16 @@ Contoso 是一家销售各种户外活动产品的公司。Contoso 的市场部 ```text 我想为 Java 应用构建容器镜像。请按照以下说明操作。 - - Java 应用位于 `java`。 - - 您的工作目录是存储库根目录。 - 首先确定您要执行的所有步骤。 + - Java 应用位于 `java/socialapp`。 + - 您的工作目录是存储库根目录。 - 创建一个 Dockerfile,`Dockerfile.java`。 - 使用 Microsoft OpenJDK 21。 - 使用多阶段构建方法。 - 从 JDK 提取 JRE。 - 为容器镜像使用目标端口号 `8080`。 + - 从主机向容器镜像添加环境变量 `CODESPACE_NAME` 和 `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN`。 + - 在容器镜像中创建 SQLite 数据库文件 `sns_api.db`。不要从主机复制文件。 ``` 1. 点击 GitHub Copilot 的 ![保留按钮图片](https://img.shields.io/badge/keep-blue) 按钮接受更改。 @@ -101,6 +103,7 @@ Contoso 是一家销售各种户外活动产品的公司。Contoso 的市场部 使用刚刚构建的容器镜像,运行容器并验证应用是否正常运行。 - 使用主机端口 `8080`。 + - `CODESPACE_NAME` 和 `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` 的值都应该是来自 GitHub Codespaces 的值。 ``` ### 容器化 .NET 应用程序 @@ -111,13 +114,14 @@ Contoso 是一家销售各种户外活动产品的公司。Contoso 的市场部 ```text 我想为 .NET 应用构建容器镜像。请按照以下说明操作。 + - 首先确定您要执行的所有步骤。 - .NET 应用位于 `dotnet`。 - 您的工作目录是存储库根目录。 - - 首先确定您要执行的所有步骤。 - 创建一个 Dockerfile,`Dockerfile.dotnet`。 - 使用 .NET 9。 - 使用多阶段构建方法。 - 为容器镜像使用目标端口号 `8080`。 + - 向容器添加环境变量 `ApiSettings__BaseUrl`。它应该指向 Java 应用程序 `http://localhost:8080/api`。 ``` 1. 点击 GitHub Copilot 的 ![保留按钮图片](https://img.shields.io/badge/keep-blue) 按钮接受更改。 @@ -141,12 +145,13 @@ Contoso 是一家销售各种户外活动产品的公司。Contoso 的市场部 使用刚刚构建的容器镜像,运行容器并验证应用是否正常运行。 - 使用主机端口 `3030`。 + - 传递环境变量 `ApiSettings__BaseUrl` 值 `http://localhost:8080/api`。 ``` 1. 确保前端和后端应用暂时无法相互通信,因为它们还不知道彼此。运行如下提示。 ```text - 无论如何,删除当前运行的两个容器。 + 删除 Java 和 .NET 容器以及它们各自的容器镜像。 ``` ### 编排容器 @@ -157,6 +162,7 @@ Contoso 是一家销售各种户外活动产品的公司。Contoso 的市场部 ```text 我想创建一个 Docker Compose 文件。请按照以下说明操作。 + - 首先确定您要执行的所有步骤。 - 您的工作目录是存储库根目录。 - 使用 `Dockerfile.java` 作为后端应用。 - 使用 `Dockerfile.dotnet` 作为前端应用。 @@ -164,7 +170,8 @@ Contoso 是一家销售各种户外活动产品的公司。Contoso 的市场部 - 使用 `contoso` 作为网络名称。 - 使用 `contoso-backend` 作为 Java 应用的容器名称。其目标端口是 8080,主机端口是 8080。 - 使用 `contoso-frontend` 作为 .NET 应用的容器名称。其目标端口是 8080,主机端口是 3030。 - - 为 Java 应用使用的数据库挂载卷,`java/socialapp/sns_api.db`。 + - 从主机向 Java 容器添加环境变量 `CODESPACE_NAME` 和 `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN`。 + - 向 .NET 容器添加环境变量 `ApiSettings__BaseUrl`。它应该指向 Java 应用的 `/api`。 ``` 1. 点击 GitHub Copilot 的 ![保留按钮图片](https://img.shields.io/badge/keep-blue) 按钮接受更改。 @@ -172,7 +179,7 @@ Contoso 是一家销售各种户外活动产品的公司。Contoso 的市场部 1. 创建 `compose.yaml` 文件后,运行它并验证两个应用是否正常运行。 ```text - 现在,运行 Docker compose 文件并验证应用是否正常运行。 + 运行 Docker compose 文件并验证所有应用是否正常运行。 ``` 1. 打开 Web 浏览器并导航到 `http://localhost:3030`,验证应用是否正常运行。