Add Dockerfile

This commit is contained in:
Kai Vogelgesang 2022-09-25 23:57:27 +02:00
parent fb44bc2178
commit 466449b7b8
Signed by: kai
GPG Key ID: 0A95D3B6E62C0879

30
Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM archlinux:base-devel AS builder
RUN pacman -Syu npm 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 && \
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"]