https://github.com/alfg/docker-vapor
A Docker build for Vapor
https://github.com/alfg/docker-vapor
api docker http swift vapor
Last synced: 9 months ago
JSON representation
A Docker build for Vapor
- Host: GitHub
- URL: https://github.com/alfg/docker-vapor
- Owner: alfg
- License: mit
- Created: 2018-12-17T01:24:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-29T05:01:41.000Z (over 6 years ago)
- Last Synced: 2025-04-12T23:27:10.705Z (12 months ago)
- Topics: api, docker, http, swift, vapor
- Language: Swift
- Homepage: https://github.com/alfg/docker-vapor
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker Vapor
A simple Docker Vapor example.
[](https://hub.docker.com/r/alfg/vapor/)
[](https://hub.docker.com/r/alfg/vapor/)
[](https://hub.docker.com/r/alfg/vapor/builds/)
## Usage
* Build Docker image:
```bash
$ docker-compose build
```
* Run bash in container:
```bash
$ docker-compose run --service-ports app
```
* Build and run:
```bash
$ swift build
$ ./.build/x86_64-unknown-linux/debug/Run -b 0.0.0.0
Running default command: ./.build/x86_64-unknown-linux/debug/Run serve
Server starting on http://0.0.0.0:8080
```
> Note: You must bind to `0.0.0.0` so you can access from outside the container.
* Load `http://localhost:8080/hello`:
```
$ curl http://localhost:8080/hello
Hello, world.
```
## Resources
* https://docs.vapor.codes/3.0/install/ubuntu/
## License
MIT