1
0
Fork 0
mirror of https://github.com/EDeev/worldlang.git synced 2026-10-07 20:49:41 +03:00

Docker-образ с сайтом (nginx) и релизы: образ публикуется в GHCR по тегу v*

This commit is contained in:
Деев Егор Викторович 2026-10-06 22:12:25 +03:00
parent 06d54151c5
commit fa0a8673ce
6 changed files with 69 additions and 0 deletions

6
.dockerignore Normal file
View file

@ -0,0 +1,6 @@
.git
.github
docs
*.md
.eslintrc.json
.htmlhintrc

35
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: Docker
on:
push:
tags: ["v*"]
workflow_dispatch:
jobs:
image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/edeev/worldlang
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

7
Dockerfile Normal file
View file

@ -0,0 +1,7 @@
# Сайт онлайн-школы языков WorldLang — статика за nginx, /api проксируется на учебный API
FROM nginx:1.27-alpine
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY index.html account.html /usr/share/nginx/html/
COPY css /usr/share/nginx/html/css
COPY js /usr/share/nginx/html/js
EXPOSE 80

View file

@ -3,6 +3,7 @@
[Русский](README.md) · **English**
[![CI](https://github.com/EDeev/worldlang/actions/workflows/ci.yml/badge.svg)](https://github.com/EDeev/worldlang/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/EDeev/worldlang)](https://github.com/EDeev/worldlang/releases)
Exam project for the "Web Technologies Basics" course: an online language school site with a course and
tutor catalog, applications, a personal account and a map of learning places, built on the course API.
@ -28,6 +29,9 @@ API at `/api`. To run from disk, put the full API URL (given in a comment) into
Checks: `node --check js/*.js` and `npx htmlhint *.html` (rules in `.htmlhintrc`, also run by CI).
**Docker:** a prebuilt image — `docker run -p 8080:80 ghcr.io/edeev/worldlang` (or `git.deev.su/edeev/worldlang`): nginx
serves the site and proxies the course API at `/api`; open http://localhost:8080.
## License
Coursework (Web Technologies Basics, Moscow Polytechnic University, 2025/26). The code is open for study;

View file

@ -3,6 +3,7 @@
**Русский** · [English](README.en.md)
[![CI](https://github.com/EDeev/worldlang/actions/workflows/ci.yml/badge.svg)](https://github.com/EDeev/worldlang/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/EDeev/worldlang)](https://github.com/EDeev/worldlang/releases)
Экзаменационный проект по «Основам веб-технологий»: сайт онлайн-школы иностранных языков с каталогом
курсов и репетиторов, заявками, личным кабинетом и картой учебных ресурсов на учебном API.
@ -28,6 +29,9 @@
Проверки: `node --check js/*.js` и `npx htmlhint *.html` (правила — в `.htmlhintrc`, их же гоняет CI).
**Docker:** готовый образ — `docker run -p 8080:80 ghcr.io/edeev/worldlang` (или `git.deev.su/edeev/worldlang`): nginx
отдаёт сайт и сам проксирует учебный API на `/api`, сайт откроется на http://localhost:8080.
## Лицензия
Учебный проект (Основы веб-технологий, Московский Политех, 2025/26). Код открыт для изучения, отдельной

13
docker/nginx.conf Normal file
View file

@ -0,0 +1,13 @@
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
# учебный API под тем же адресом, что и сайт (как на lang.deev.su)
location /api/ {
resolver 1.1.1.1 8.8.8.8 valid=300s;
set $api exam-api-courses.std-900.ist.mospolytech.ru;
proxy_pass http://$api$request_uri;
proxy_set_header Host $api;
}
}