2024-09-02 00:49:10 +08:00
|
|
|
FROM node:18.16.0-alpine AS webapp-build
|
2024-01-26 01:52:03 +08:00
|
|
|
RUN apk update && apk add bash
|
|
|
|
RUN npm i -g pnpm
|
|
|
|
RUN mkdir -p /app
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ./package.json /app
|
|
|
|
COPY ./pnpm-lock.yaml /app
|
|
|
|
RUN pnpm install
|
|
|
|
COPY ./webapp /app/webapp
|
|
|
|
COPY ./index.html /app
|
|
|
|
COPY ./public /app/public
|
|
|
|
COPY ./*.js /app
|
|
|
|
COPY ./*.json /app
|
|
|
|
RUN pnpm webapp:build:only
|
|
|
|
|
|
|
|
|
2024-09-02 00:49:10 +08:00
|
|
|
FROM python:3.12.3-bookworm AS server-aio
|
2024-01-26 01:52:03 +08:00
|
|
|
RUN apt-get update && apt-get install -y git libpq-dev gcc
|
|
|
|
COPY ./requirements.txt /tmp/requirements.txt
|
|
|
|
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
|
|
|
|
WORKDIR /app
|
2024-09-02 02:04:48 +08:00
|
|
|
COPY . /app
|
2024-01-27 01:08:02 +08:00
|
|
|
RUN rm -rf /app/felicity/templates/static/*
|
|
|
|
COPY --from=webapp-build /app/dist /app/felicity/templates/static
|
2024-09-02 02:04:48 +08:00
|
|
|
RUN cd /app && pip install -e .
|
2024-01-26 01:52:03 +08:00
|
|
|
ENV PYTHONPATH=/app
|
2024-01-27 01:08:02 +08:00
|
|
|
CMD ["gunicorn", "felicity.main:felicity", "--bind", "0.0.0.0:8000", "--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker"]
|
2024-01-26 01:52:03 +08:00
|
|
|
|
|
|
|
|
2024-09-02 00:49:10 +08:00
|
|
|
FROM python:3.12.3-bookworm AS server-api
|
2024-01-26 01:52:03 +08:00
|
|
|
RUN apt-get update && apt-get install -y git libpq-dev gcc
|
|
|
|
COPY ./requirements.txt /tmp/requirements.txt
|
|
|
|
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
|
|
|
|
WORKDIR /app
|
2024-09-02 02:04:48 +08:00
|
|
|
COPY . /app/
|
2024-01-27 01:08:02 +08:00
|
|
|
RUN rm -rf /app/felicity/templates/static/*
|
2024-09-02 02:04:48 +08:00
|
|
|
RUN cd /app && pip install -e .
|
2024-01-26 01:52:03 +08:00
|
|
|
ENV PYTHONPATH=/app
|
2024-01-27 01:08:02 +08:00
|
|
|
CMD ["gunicorn", "felicity.main:felicity", "--bind", "0.0.0.0:8000", "--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker"]
|
2024-01-26 01:52:03 +08:00
|
|
|
|
|
|
|
|
2024-09-02 00:49:10 +08:00
|
|
|
FROM nginx:latest AS nginx-static
|
2024-01-26 01:52:03 +08:00
|
|
|
RUN mkdir /app
|
|
|
|
COPY --from=webapp-build /app/dist /app
|
|
|
|
|
|
|
|
|
2024-09-02 00:49:10 +08:00
|
|
|
FROM caddy:2-alpine AS caddy-static
|
2024-01-26 01:52:03 +08:00
|
|
|
RUN mkdir /app
|
2024-01-28 21:17:16 +08:00
|
|
|
COPY --from=webapp-build /app/dist /app
|