Skip to content

Commit

Permalink
[#7] Add docker-compose.yml, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaPrete committed Mar 31, 2020
1 parent b476904 commit d8adf22
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
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"

0 comments on commit d8adf22

Please sign in to comment.