31 lines
590 B
Docker
31 lines
590 B
Docker
FROM archlinux:base-devel AS builder
|
|
|
|
RUN pacman -Syu npm lua luarocks just --noconfirm
|
|
|
|
# build frontend
|
|
WORKDIR /frontend
|
|
COPY frontend .
|
|
RUN npm install && npm run build
|
|
|
|
# build lua
|
|
WORKDIR /lua
|
|
COPY lua .
|
|
RUN luarocks install tl && \
|
|
luarocks install dumbluaparser && \
|
|
eval $(luarocks path) && \
|
|
just build
|
|
|
|
# build final container
|
|
FROM python:3
|
|
WORKDIR /usr/src/app
|
|
COPY server .
|
|
COPY --from=builder /frontend/dist frontend
|
|
COPY --from=builder /lua/out lua
|
|
|
|
RUN pip install -e "."
|
|
|
|
ENV UVICORN_HOST="0.0.0.0"
|
|
ENV UVICORN_PORT="80"
|
|
EXPOSE 80
|
|
|
|
CMD ["uvicorn", "server:app"] |