Skip to content

Commit

Permalink
Replace to rust
Browse files Browse the repository at this point in the history
  • Loading branch information
odd12258053 committed Mar 18, 2021
1 parent 166b7cc commit f832ff5
Show file tree
Hide file tree
Showing 11 changed files with 268 additions and 235 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
build/
dist/
poetry.lock
__pycache__/
target/
Cargo.lock
.idea/
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "docker-compose-host"
version = "0.1.0"
authors = ["odd <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = "1.0.124"
serde_derive = "1.0.124"
serde_json = "1.0"
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

17 changes: 17 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG PYTHON_VERSION='3.8'

FROM python:${PYTHON_VERSION}

ARG ENV
ENV APP_DIR /var/app

RUN apt-get update -yqq && apt-get install -yqq gcc
RUN pip install -q --upgrade pip
RUN pip install -q fastapi uvicorn

WORKDIR ${APP_DIR}
COPY ./ ${APP_DIR}

EXPOSE 8000
ENTRYPOINT ["uvicorn"]
CMD ["main:app"]
8 changes: 8 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fastapi import FastAPI

app = FastAPI()


@app.get('/')
def hello() -> str:
return 'hello'
140 changes: 0 additions & 140 deletions bin/docker-compose-host.py

This file was deleted.

33 changes: 0 additions & 33 deletions docker-compose-host.spec

This file was deleted.

4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
api:
build: ./api
command: ["--reload", "--host", "0.0.0.0", "main:app"]
16 changes: 0 additions & 16 deletions format.ini

This file was deleted.

31 changes: 0 additions & 31 deletions pyproject.toml

This file was deleted.

Loading

0 comments on commit f832ff5

Please sign in to comment.