Dynavera/compose/prod/Dockerfile

40 lines
817 B
Text
Raw Normal View History

FROM node:22-alpine AS node
WORKDIR /app
LABEL org.opencontainers.image.source="TBC"
LABEL org.opencontainers.image.description="FYP Image"
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM python:3.14.0-bookworm as python
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
libpq-dev \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir --requirement /requirements.txt
WORKDIR /app
RUN apt-get update && apt-get install --no-install-recommends -y \
sudo git bash-completion nano ssh
COPY . .
COPY --from=node /app/build ./build
COPY ./compose/prod/start /start
RUN sed -i 's/\r$//g' /start
RUN chmod +x /start
ENTRYPOINT ["/start"]