-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 897 Bytes
/
Dockerfile
File metadata and controls
37 lines (27 loc) · 897 Bytes
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
FROM --platform=linux/amd64 node:18-alpine AS frontend-builder
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm install
COPY frontend/ .
RUN npm run build
FROM --platform=linux/amd64 python:3.11
WORKDIR /app
RUN apt-get update && apt-get install -y \
curl \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN solc-select install 0.8.0 && solc-select use 0.8.0
COPY . .
COPY --from=frontend-builder /frontend/dist ./frontend/dist
RUN mkdir -p /app/reports /app/logs
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
ENV PORT=8000
ENV SOLC_VERSION=0.8.0
HEALTHCHECK --interval=60s --timeout=30s --start-period=120s --retries=3 \
CMD curl -f http://localhost:$PORT/health || exit 1
EXPOSE 8000
CMD ["python", "-m", "uvicorn", "api.simple_api:app", "--host", "0.0.0.0", "--port", "8000"]