This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from bemble/python_server
Move server from go to Python
- Loading branch information
Showing
143 changed files
with
4,630 additions
and
4,386 deletions.
There are no files selected for viewing
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,13 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "front" | ||
}, | ||
{ | ||
"path": "server" | ||
}, | ||
{ | ||
"path": "." | ||
} | ||
] | ||
} |
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
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
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,43 +1,26 @@ | ||
# Server build | ||
FROM golang:1.20-alpine as server-builder | ||
|
||
RUN apk add --no-cache \ | ||
alpine-sdk \ | ||
ca-certificates \ | ||
tzdata | ||
|
||
# Force the go compiler to use modules | ||
ENV GO111MODULE=on | ||
|
||
ADD . /app | ||
WORKDIR /app/server | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -o holerr . | ||
|
||
# Front build | ||
FROM node:14-alpine as front-builder | ||
RUN apk add --no-cache --virtual python3 py3-pip make g++ | ||
RUN apk add tzdata | ||
FROM node:20-alpine as front-builder | ||
RUN apk add --no-cache python3 py3-pip make g++ | ||
|
||
ADD . /app | ||
WORKDIR /app/front | ||
RUN npm ci install | ||
RUN CI=false GENERATE_SOURCEMAP=false npm run build:docker | ||
|
||
# Final image | ||
FROM scratch | ||
FROM python:3.12-alpine | ||
|
||
ARG APP_VERSION | ||
ENV IS_IN_DOCKER=1 | ||
ENV APP_VERSION=${APP_VERSION} | ||
|
||
# copy front files | ||
COPY --from=front-builder /app/public /app/public | ||
|
||
# copy server files | ||
COPY --from=server-builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=server-builder /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=server-builder /app/server/holerr /app/server/holerr | ||
COPY ./server /app/server | ||
|
||
ENTRYPOINT ["/app/server/holerr"] | ||
WORKDIR /app/server | ||
RUN pip install -r requirements.txt | ||
CMD ["python", "-m", "holerr"] | ||
|
||
EXPOSE 8781 | ||
EXPOSE 8765 |
Oops, something went wrong.