Skip to content

Commit fba60d4

Browse files
build: streamline Dockerfile and bump deps
Signed-off-by: francesco-racciatti <francesco.racciatti@sysdig.com>
1 parent 64d945f commit fba60d4

File tree

5 files changed

+140
-68
lines changed

5 files changed

+140
-68
lines changed

Dockerfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
FROM python:3.7-buster
1+
FROM python:3.9-slim
22

3-
RUN pip install pipenv==2018.11.26
3+
RUN pip install --upgrade pipenv
44

55
WORKDIR /app
6-
7-
COPY Pipfile /app
8-
COPY Pipfile.lock /app
6+
COPY . .
97
RUN pipenv install --system --deploy
108

11-
COPY app.py /app
12-
139
EXPOSE 8080
1410

15-
CMD ["gunicorn", "-b", ":8080", "--workers", "2", "--threads", "4", "--worker-class", "gthread", "--access-logfile", "-", "--error-logfile", "-", "app:app"]
11+
ENTRYPOINT ["./entrypoint.sh"]

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[source]]
2-
url = "https://pypi.python.org/simple"
2+
url = "https://pypi.org/simple"
33
verify_ssl = true
44
name = "pypi"
55

@@ -10,4 +10,4 @@ gunicorn = "*"
1010
[dev-packages]
1111

1212
[requires]
13-
python_version = "3.7"
13+
python_version = "3.9"

Pipfile.lock

Lines changed: 123 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
![last commit](https://flat.badgen.net/github/last-commit/sysdiglabs/security-playground?icon=github) ![licence](https://flat.badgen.net/github/license/sysdiglabs/security-playground) ![docker pulls](https://flat.badgen.net/docker/pulls/sysdiglabs/security-playground?icon=docker)
44

5-
The security playground is a HTTP web server to simulate security breaches in
6-
run time.
5+
The security playground is an HTTP web server to simulate security breaches. It allows you to read, write, and execute commands in a containerized environment.
76

87
## Installation
98

10-
Use the docker image to deploy it in your Kubernetes cluster or locally in a
11-
container.
9+
Deploy the docker image in your environment.
1210

1311
```bash
1412
$ docker run --rm -p 8080:8080 sysdiglabs/security-playground
1513
```
1614

15+
Setup the health check to the `/health` endpoint if required.
16+
17+
1718
## Usage
1819

1920
The HTTP API exposes tree endpoints to interact with the system.
@@ -40,10 +41,10 @@ This will write to /bin/hello the hello-world string
4041

4142
### Executing a command
4243

43-
You can execute a command using the /exec endpoint and POSTing the command.
44+
You can execute a command using the `/exec` endpoint and POSTing the command.
4445

4546
```bash
46-
$ curl -X POST /exec -d 'command=ls -la'
47+
$ curl -X POST localhost:8080/exec -d 'command=ls -la'
4748
```
4849

49-
This will capture and return the STDOUT of the command executed.
50+
This will capture and return the STDOUT of the executed command.

entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gunicorn -b :8080 --workers 2 --threads 4 --worker-class gthread --access-logfile - --error-logfile - app:app

0 commit comments

Comments
 (0)