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

[#7] Add docker-compose.yml, update readme #8

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
[![Join the #publiccode channel](https://img.shields.io/badge/Slack%20channel-%23publiccode-blue.svg?logo=slack)](https://developersitalia.slack.com/messages/CAM3F785T)
[![Get invited](https://slack.developers.italia.it/badge.svg)](https://slack.developers.italia.it/)

This is a Go web interface validator for [publiccode.yml](https://github.com/italia/publiccode.yml) files, it uses [publiccode-parser-go](https://github.com/italia/publiccode-parser-go).
This is a Go, web interface validator for [publiccode.yml](https://github.com/italia/publiccode.yml) files, using [publiccode-parser-go](https://github.com/italia/publiccode-parser-go).

publiccode.yml is an international standard for describing public software. It is expected to be published in the root of open source repositories. This parser performs syntactic and semantic validation according to the official spec.

## Features

See related project for details: [publiccode-parser-go](https://github.com/italia/publiccode-parser-go)


## Validation from command line

This repository also contains an executable tool which can be used for validating a publiccode.yml file locally.
The repository also contains a tool used to validate publiccode.yml files locally.

```bash
go run src/main.go

```sh
$ go run src/main.go
$ curl -XPOST localhost:5000/pc/validate -d '{
curl -XPOST localhost:5000/pc/validate -d '{
"localisation": {
"localisationReady": false
},
Expand All @@ -31,11 +33,24 @@ $ curl -XPOST localhost:5000/pc/validate -d '{
```
## Docker support

This project can be packaged and executed using Docker as follow:
The repository has a *Dockerfile*, used to also build the production image, and a *docker-compose.yml* file to facilitate the local deployment.

To build the container, run:

```shell
docker-compose up [-d] [--build]
```

where:

* *-d* execute the containers in background

* *--build* forces the containers build

To destroy the container, use:

```sh
$ docker build -t pc-web-validator .
$ docker run -p5000:5000 --name pc-web-validator -it --rm pc-web-validator
```shell
docker-compose down
```


Expand All @@ -56,7 +71,7 @@ This software is maintained by the [Developers Italia](https://developers.italia

## License

© 2018-2019 Team per la Trasformazione Digitale - Presidenza del Consiglio dei Minstri
© 2018-2020 Team per la Trasformazione Digitale - Presidenza del Consiglio dei Minstri

Licensed under the EUPL.
The version control system provides attribution for specific lines of code.
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.3'

services:

devita_publiccode_validator:
image: italia/publiccode-validator
container_name: devita_publiccode_validator
build:
context: ./
dockerfile: Dockerfile
ports:
- "5000:5000"