2020-05-27 22:01:26 +02:00
|
|
|
# Docker sample
|
2020-02-24 18:48:04 +01:00
|
|
|
|
2020-05-27 22:01:26 +02:00
|
|
|
## Build image
|
2020-02-24 18:48:04 +01:00
|
|
|
|
|
|
|
```shell
|
2024-02-05 17:26:50 +01:00
|
|
|
docker build -t actix-docker .
|
2020-02-24 18:48:04 +01:00
|
|
|
```
|
|
|
|
|
2020-05-27 22:01:26 +02:00
|
|
|
## Run built image
|
2020-02-24 18:48:04 +01:00
|
|
|
|
|
|
|
```shell
|
2024-02-05 17:26:50 +01:00
|
|
|
docker run -d -p 8080:8080 actix-docker
|
2020-05-27 22:01:26 +02:00
|
|
|
# and the server should start instantly
|
2022-01-30 17:21:43 +01:00
|
|
|
curl http://localhost:8080
|
2020-05-27 22:01:26 +02:00
|
|
|
```
|
2020-02-24 18:48:04 +01:00
|
|
|
|
2020-05-27 22:01:26 +02:00
|
|
|
## Running unit tests
|
2020-02-24 18:48:04 +01:00
|
|
|
|
2020-05-27 22:01:26 +02:00
|
|
|
```shell
|
2024-02-05 17:26:50 +01:00
|
|
|
docker build -t actix-docker:test .
|
|
|
|
docker run --rm actix-docker:test
|
2020-05-27 22:01:26 +02:00
|
|
|
```
|