mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-21 07:22:53 +08:00
50 lines
1.7 KiB
Text
50 lines
1.7 KiB
Text
FROM node:18.16.0-alpine AS webapp-build
|
|
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
|
|
|
|
|
|
FROM python:3.12.3-bookworm AS server-aio
|
|
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
|
|
COPY . /app
|
|
RUN rm -rf /app/felicity/templates/static/*
|
|
COPY --from=webapp-build /app/dist /app/felicity/templates/static
|
|
RUN cd /app && pip install -e .
|
|
ENV PYTHONPATH=/app
|
|
CMD ["gunicorn", "felicity.main:felicity", "--bind", "0.0.0.0:8000", "--workers", "1", "--worker-class", "uvicorn.workers.UvicornWorker"]
|
|
|
|
|
|
FROM python:3.12.3-bookworm AS server-api
|
|
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
|
|
COPY . /app/
|
|
RUN rm -rf /app/felicity/templates/static/*
|
|
RUN cd /app && pip install -e .
|
|
ENV PYTHONPATH=/app
|
|
CMD ["gunicorn", "felicity.main:felicity", "--bind", "0.0.0.0:8000", "--workers", "1", "--worker-class", "uvicorn.workers.UvicornWorker"]
|
|
|
|
FROM nginx:latest AS nginx-static
|
|
RUN mkdir /app
|
|
COPY --from=webapp-build /app/dist /app
|
|
COPY ./services/nginx/static/default.conf.template /etc/nginx/templates/default.conf.template
|
|
CMD ["nginx", "-g", "daemon off;"]
|
|
|
|
FROM caddy:2-alpine AS caddy-static
|
|
RUN mkdir /app
|
|
COPY --from=webapp-build /app/dist /app
|
|
COPY ./services/caddy/static/Caddyfile /etc/caddy/Caddyfile
|