-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
This file contains 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
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).
☁️ Nx Cloud ReportCI 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 targetSent 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
temporarily deployed
to
production
December 2, 2024 23:01 — with
GitHub Actions
Inactive
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.
Add a Dockerfile for deploying the server backend to Azure.
Dockerfile:
node:20-alpine
as the base image./app
.package.json
andpnpm-lock.yaml
to the working directory.pnpm install --frozen-lockfile
.pnpm nx build server --verbose
.node dist/apps/server/main.js
.package.json:
docker:build
to build the Docker image.For more details, open the Copilot Workspace session.