https://github.com/hexlet-components/devops-example-app
https://github.com/hexlet-components/devops-example-app
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hexlet-components/devops-example-app
- Owner: hexlet-components
- Created: 2021-05-13T07:09:41.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-07-11T20:41:16.000Z (almost 3 years ago)
- Last Synced: 2024-04-14T22:46:55.436Z (about 2 years ago)
- Language: JavaScript
- Homepage: https://devops-application.hexlet.app
- Size: 969 KB
- Stars: 4
- Watchers: 9
- Forks: 29
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DevOps example app
 [](https://hub.docker.com/r/hexletcomponents/devops-example-app)
This is a simple node application that shows on the main page server on which it is running and report errors to [Rollbar](https://rollbar.com/).
## Usage
```bash
docker run -p 3000:3000 -e SERVER_MESSAGE="Hexlet Awesome Server" -e ROLLBAR_TOKEN="" hexletcomponents/devops-example-app
# open http://0.0.0.0:3000 in browser
```
## Запуск на Mac M1/M2 (ARM) и других архитектурах
Если при запуске контейнера возникает ошибка:
```
docker: no matching manifest for linux/arm64/v8 in the manifest list entries.
```
Возможные решения:
### 1. Использовать эмуляцию x86 через флаг --platform
```sh
docker run --platform linux/amd64 -p 3000:3000 \
-e SERVER_MESSAGE="Hexlet Awesome Server" \
hexletcomponents/devops-example-app
```
Docker Desktop для Mac M1/M2 поддерживает эмуляцию x86 (amd64) через QEMU. Это работает для большинства Node.js-приложений, но может быть медленнее.
### 2. Собрать образ локально под ARM
```sh
docker build -t hexletcomponents/devops-example-app .
docker run -p 3000:3000 \
-e SERVER_MESSAGE="Hexlet Awesome Server" \
hexletcomponents/devops-example-app
```
### 3. Собрать и опубликовать multi-arch образ (рекомендовано)
```sh
docker buildx build --platform linux/amd64,linux/arm64 -t hexletcomponents/devops-example-app --push .
```
После этого команда `docker run ...` будет работать на любой архитектуре.
### 4. Проверить, что эмуляция включена
Если эмуляция не работает, выполните:
```sh
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
```
## Requirements
* Make
## Install
```bash
make setup
```
You may pass environment variable `SERVER_MESSAGE`, and its value shows on the main page.
Edit *.env* file to set up environment variables.
```env
SERVER_MESSAGE="Hexlet Awesome Server"
ROLLBAR_TOKEN=
```
## Start application
```bash
make start
# open http://0.0.0.0:3000 in browser
```

---
[](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=devops-example-app)
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=devops-example-app).
See most active contributors on [hexlet-friends](https://friends.hexlet.io/).