|
1 | 1 | # Portfolio Starter |
2 | 2 |
|
3 | | -This is my starter portfolio that I worked on based on the template from [Vercel](https://portfolio-blog-starter.vercel.app). |
| 3 | +This is my start### Build the Docker image |
4 | 4 |
|
5 | | -## Versioning |
| 5 | +```bash |
| 6 | +docker build -t online-cv . |
| 7 | +``` |
| 8 | + |
| 9 | +### Build Multi-platform Docker image (AMD64 + ARM64) |
| 10 | + |
| 11 | +For compatibility with both Intel/AMD and Apple Silicon (M1/M2) processors: |
6 | 12 |
|
7 | | -I follow the format from [semantic-release](https://semantic-release.gitbook.io/semantic-release). |
| 13 | +```bash |
| 14 | +# Create a new builder instance (one-time setup) |
| 15 | +docker buildx create --name multiplatform --use |
| 16 | + |
| 17 | +# Build for multiple platforms |
| 18 | +docker buildx build --platform linux/amd64,linux/arm64 -t online-cv:latest . |
| 19 | +```rtfolio that I worked on based on the template from [Vercel](https://portfolio-blog-starter.vercel.app). |
8 | 20 |
|
9 | | -## Demo |
| 21 | +## Progress (Temporal) |
10 | 22 |
|
11 | | -Demonstration of the original website cloned from Vercel, with the blogs pages. |
| 23 | +- 🕐Adapt pipeline |
| 24 | +- 🚧Test container in the cloud |
| 25 | +- ✅Solve issue to fetch experiences from container |
| 26 | +- ✅Solve styles missed when running container |
12 | 27 |
|
13 | | -https://portfolio-blog-starter.vercel.app |
| 28 | +## Documentation |
14 | 29 |
|
15 | | -**NOTE**: This URL will be updated with a website that relies on the code used by this project. |
| 30 | +- [Content Management](./Docs/CONTENT_MANAGEMENT.md) |
16 | 31 |
|
17 | 32 | ## How to Use |
18 | 33 |
|
19 | 34 | Clone this repository and then run: |
20 | 35 | ```bash |
21 | | -pnpm install |
| 36 | +npm install --legacy-peer-deps |
22 | 37 | ``` |
23 | 38 |
|
24 | 39 | Afterwards |
25 | 40 | ```bash |
26 | | -pnpm dev |
| 41 | +npm run dev |
| 42 | +``` |
| 43 | + |
| 44 | +### Test build before triggering Github actions |
| 45 | + |
| 46 | +```bash |
| 47 | +npm run build |
| 48 | +``` |
| 49 | + |
| 50 | +## Run with Docker |
| 51 | + |
| 52 | +To run the application using Docker: |
| 53 | + |
| 54 | +### Build the Docker image |
| 55 | + |
| 56 | +```bash |
| 57 | +docker build -t onlinecv . |
27 | 58 | ``` |
28 | 59 |
|
29 | | -## Test build before triggering Github actions |
| 60 | +### Run the Docker container |
30 | 61 |
|
31 | | -```` |
32 | | -pnpm build |
33 | | -```` |
| 62 | +```bash |
| 63 | +docker run -p 3000:8080 |
| 64 | + -e COSMOS_ENDPOINT=https://your-cosmos-account.documents.azure.com:443/ |
| 65 | + -e COSMOS_KEY=your_cosmos_key_here |
| 66 | + -e COSMOS_DATABASE=your_db_here |
| 67 | + -e COSMOS_CONTAINER=your_container_here |
| 68 | + -e NODE_ENV=production |
| 69 | + onlinecv |
| 70 | +``` |
| 71 | + |
| 72 | +**Important**: Do not use quotes around the environment variable values when using `-e` flag. |
| 73 | + |
| 74 | +**Environment Variables:** |
| 75 | + |
| 76 | +- `COSMOS_ENDPOINT`: Your Azure Cosmos DB endpoint URL (without quotes) |
| 77 | +- `COSMOS_KEY`: Your Azure Cosmos DB access key (without quotes) |
| 78 | +- `COSMOS_DATABASE`: Database name (defaults to "onlineCv") |
| 79 | +- `COSMOS_CONTAINER`: Container name (defaults to "experience") |
| 80 | +- `NODE_ENV`: Set to "production" for production builds |
| 81 | + |
| 82 | +**Alternative with .env file:** |
| 83 | + |
| 84 | +Create a `.env` file with these variables (without quotes): |
| 85 | +```env |
| 86 | +COSMOS_ENDPOINT=https://your-cosmos-account.documents.azure.com:443/ |
| 87 | +COSMOS_KEY=your_cosmos_key_here |
| 88 | +COSMOS_DATABASE=onlineCv |
| 89 | +COSMOS_CONTAINER=experience |
| 90 | +NODE_ENV=production |
| 91 | +``` |
34 | 92 |
|
35 | | -**Not using pnpm?** Check [pnpm's website](https://pnpm.io/installation) to know how to install it. |
| 93 | +Then run: |
| 94 | +```bash |
| 95 | +docker run -p 3000:8080 --env-file .env onlinecv |
| 96 | +``` |
36 | 97 |
|
37 | | -## How to generate data for the projects/volunteering/workExperience page(s) |
| 98 | +The application will be available at `http://localhost:3000` |
38 | 99 |
|
39 | | -### Create a file |
| 100 | +## Deploy to Azure Container Registry |
40 | 101 |
|
41 | | -On the path '/app/<folder>/posts', create a file with any name but in format '.mdx' |
| 102 | +To deploy your Docker image to Azure Container Registry for use with Azure services: |
42 | 103 |
|
43 | | -### Populate the file |
| 104 | +### Login to Azure Container Registry |
44 | 105 |
|
45 | | -On the file created on the previous step, fill the file with the following format: |
| 106 | +```bash |
| 107 | +az acr login --name <your-registry-name> |
| 108 | +``` |
46 | 109 |
|
47 | | -``` |
48 | | ---- |
49 | | -sdate: '<start_month.year>' |
50 | | -edate: '<end_month.year>' |
51 | | -company: '<company_name>' |
52 | | -location: '<location>' |
53 | | -jobTitle: '<jot_title>' |
54 | | ---- |
| 110 | +### Tag your image for Azure Container Registry |
55 | 111 |
|
56 | | -* <Description about the position.> |
| 112 | +```bash |
| 113 | +docker tag <local-container-name> <your-registry-name>.azurecr.io<remote-container-name>:latest |
57 | 114 | ``` |
58 | 115 |
|
| 116 | +### Push the image to Azure Container Registry |
| 117 | + |
| 118 | +```bash |
| 119 | +docker push <your-registry-name>.azurecr.io<remote-container-name>:latest |
| 120 | +``` |
59 | 121 |
|
60 | 122 | ## Contact |
61 | 123 |
|
|
0 commit comments