Skip to content
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

Add Dockerfile for server backend deployment to Azure #101

Merged
merged 26 commits into from
Dec 3, 2024

Conversation

endersonmenezes
Copy link
Member

@endersonmenezes endersonmenezes commented Dec 2, 2024

Add a Dockerfile for deploying the server backend to Azure.

  • Dockerfile:

    • Use node:20-alpine as the base image.
    • Set the working directory to /app.
    • Copy package.json and pnpm-lock.yaml to the working directory.
    • Install dependencies using pnpm install --frozen-lockfile.
    • Copy the rest of the application code to the working directory.
    • Build the application using pnpm nx build server --verbose.
    • Expose port 3000.
    • Set the command to run the application using node dist/apps/server/main.js.
  • package.json:

    • Add a new script docker:build to build the Docker image.

For more details, open the Copilot Workspace session.

Add a Dockerfile for deploying the server backend to Azure.

* **Dockerfile**: 
  - Use `node:20-alpine` as the base image.
  - Set the working directory to `/app`.
  - Copy `package.json` and `pnpm-lock.yaml` to the working directory.
  - Install dependencies using `pnpm install --frozen-lockfile`.
  - Copy the rest of the application code to the working directory.
  - Build the application using `pnpm nx build server --verbose`.
  - Expose port 3000.
  - Set the command to run the application using `node dist/apps/server/main.js`.

* **package.json**:
  - Add a new script `docker:build` to build the Docker image.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/DeveloperParana/devmx?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

nx-cloud bot commented Dec 2, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c5e1ca9. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

* **Backend Dockerfile**
  - Add instructions to build and run the backend server
  - Use node:20-alpine as the base image
  - Set the working directory to /app
  - Copy package.json and pnpm-lock.yaml to the working directory
  - Install dependencies using pnpm install --frozen-lockfile
  - Copy the rest of the application code to the working directory
  - Build the application using pnpm nx build devmx --verbose
  - Expose port 3000
  - Set the command to run the application using node dist/apps/server/main.js

* **Frontend Dockerfile**
  - Add instructions to build and run the frontend application
  - Use node:20-alpine as the base image
  - Set the working directory to /app
  - Copy package.json and pnpm-lock.yaml to the working directory
  - Install dependencies using pnpm install --frozen-lockfile
  - Copy the rest of the application code to the working directory
  - Build the application using pnpm nx build devmx --verbose
  - Expose port 4200
  - Set the command to run the application using pnpm nx serve devmx

* **package.json**
  - Add docker-compose script to start all services using Docker Compose

* **docker-compose.yml**
  - Add server service to build and run the backend server
  - Add devmx service to build and run the frontend application
  - Configure mongodb service to depend on server and devmx services
* **package.json**
  - Add scripts for building and running Docker containers
  - Add `docker:build:devmx` and `docker:run:devmx` scripts

* **.dockerignore**
  - Create a new `.dockerignore` file
  - Add patterns to ignore unnecessary files and directories
  - Include `node_modules`, `dist`, `tmp`, `.git`, and other temporary files
* **docker-compose.yml**
  - Update to use `Dockerfile.server` for server and `Dockerfile.front` for front-end
* **package.json**
  - Add scripts for building and running server and front-end Docker images
* **Dockerfile.server**
  - Add new Dockerfile for server with build and run instructions
* **Dockerfile.front**
  - Add new Dockerfile for front-end with build and run instructions
…Parana/devmx into endersonmenezes/add-dockerfile
@endersonmenezes endersonmenezes merged commit 5770af4 into main Dec 3, 2024
2 of 3 checks passed
@endersonmenezes endersonmenezes deleted the endersonmenezes/add-dockerfile branch December 3, 2024 02:19
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.

1 participant