Skip to content

Commit

Permalink
Add SSL support for api
Browse files Browse the repository at this point in the history
  • Loading branch information
Waujito committed Mar 16, 2024
1 parent d4a35d3 commit f2db5e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ hs_err_pid*
replay_pid*

**/*.env
!**/*.example.env
!**/*.example.env

# Certificates used for development
crt/
11 changes: 5 additions & 6 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN apt update -y && apt upgrade -y



FROM env as build

WORKDIR /app/
Expand All @@ -29,7 +28,11 @@ RUN cp dist/$(ls dist | head -1) /prj/

FROM python:3.11-alpine as prod

RUN pip install pyuwsgi
# RUN pip install pyuwsgi
RUN apk update && apk add gcc openssl openssl-dev python3-dev build-base linux-headers pcre-dev

RUN CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" \
UWSGI_PROFILE_OVERRIDE=ssl=true pip3 install uwsgi -Iv

RUN mkdir /prj
COPY --from=build /prj/* /prj/
Expand All @@ -38,15 +41,11 @@ RUN pip install /prj/$(ls /prj)

COPY uwsgi.ini .



ENTRYPOINT [ "uwsgi", "uwsgi.ini"]






FROM env as dev
RUN conda create -n cenv python=3.11

Expand Down
3 changes: 2 additions & 1 deletion api/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ master = 1
socket = 0.0.0.0:3031
http = 0.0.0.0:80
stats = 0.0.0.0:9191
stats-http = 1
stats-http = 1
https=0.0.0.0:443,/crt/tls.crt,/crt/tls.key,HIGH

0 comments on commit f2db5e7

Please sign in to comment.