-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up python shit and get first go server working
- Loading branch information
Showing
16 changed files
with
52 additions
and
134 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
FROM python:3.11 | ||
FROM golang:bookworm | ||
|
||
WORKDIR /code | ||
WORKDIR /app | ||
|
||
COPY ./requirements.txt /code/requirements.txt | ||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | ||
COPY ./src /app | ||
|
||
COPY ./app /code/app | ||
|
||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001"] | ||
CMD ["go", "run", "main.go"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
version: '3.8' | ||
|
||
services: | ||
http: | ||
server: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8001:8001" | ||
restart: always | ||
restart: always |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
) | ||
|
||
type healthcheckHandler struct{} | ||
|
||
func (h *healthcheckHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | ||
w.Header().Set("content-type", "text/plain") | ||
|
||
switch { | ||
case r.Method == http.MethodGet: | ||
msg := []byte("hello there") | ||
w.WriteHeader(http.StatusOK) | ||
w.Write(msg) | ||
return | ||
default: | ||
return | ||
} | ||
} | ||
|
||
func main() { | ||
mux := http.NewServeMux() | ||
mux.Handle("/", &healthcheckHandler{}) | ||
|
||
log.Fatal(http.ListenAndServe("0.0.0.0:8001", mux)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters