-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
50 lines (44 loc) · 1.7 KB
/
Dockerfile.prod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 python3-git
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 python3-git
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