mirror of
https://github.com/AbaTekNTNU/followspot-psn.git
synced 2025-12-06 13:54:58 +00:00
Update dockerfile
This commit is contained in:
30
Dockerfile
30
Dockerfile
@@ -4,14 +4,17 @@ WORKDIR /frontend
|
|||||||
|
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY frontend/package.json frontend/pnpm-lock.yaml ./
|
||||||
|
|
||||||
RUN pnpm i
|
RUN pnpm i
|
||||||
|
|
||||||
|
COPY frontend .
|
||||||
|
|
||||||
FROM alpine:3.20
|
RUN pnpm build
|
||||||
|
|
||||||
RUN apk add --no-cache g++ python3 python3-dev py3-aiohttp git
|
FROM alpine:3.20 AS backend
|
||||||
|
|
||||||
|
RUN apk add --no-cache g++ python3 python3-dev git
|
||||||
|
|
||||||
RUN git clone --recursive https://github.com/vyv/psn-py.git
|
RUN git clone --recursive https://github.com/vyv/psn-py.git
|
||||||
WORKDIR /psn-py/vendors/pybind11
|
WORKDIR /psn-py/vendors/pybind11
|
||||||
@@ -20,11 +23,20 @@ RUN git fetch --tags && git checkout v2.13.6
|
|||||||
WORKDIR /psn-py
|
WORKDIR /psn-py
|
||||||
|
|
||||||
RUN g++ -O3 -Wall -shared -fPIC $(python3-config --includes) \
|
RUN g++ -O3 -Wall -shared -fPIC $(python3-config --includes) \
|
||||||
-Ivendors/psn/include -Ivendors/pybind11/include src/main.cpp \
|
-Ivendors/psn/include -Ivendors/pybind11/include src/main.cpp \
|
||||||
-o psn$(python3-config --extension-suffix)
|
-o psn$(python3-config --extension-suffix)
|
||||||
|
|
||||||
COPY backend /backend
|
RUN cp /psn-py/psn$(python3-config --extension-suffix) /output
|
||||||
WORKDIR /backend
|
|
||||||
RUN cp /psn-py/psn$(python3-config --extension-suffix) .
|
|
||||||
|
|
||||||
ENTRYPOINT ["python3", "psn_server.py"]
|
|
||||||
|
FROM alpine:3.20 AS final
|
||||||
|
|
||||||
|
RUN apk add --no-cache python3 py3-aiohttp
|
||||||
|
|
||||||
|
|
||||||
|
COPY --from=backend /output /backend/psn.so
|
||||||
|
COPY backend/psn_server.py /backend/psn_server.py
|
||||||
|
COPY --from=frontend /frontend/dist /backend/static
|
||||||
|
|
||||||
|
|
||||||
|
ENTRYPOINT ["python3", "/backend/psn_server.py"]
|
||||||
|
|||||||
Reference in New Issue
Block a user