-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.fly
58 lines (44 loc) · 1.59 KB
/
Dockerfile.fly
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
51
52
53
54
55
56
57
58
# Use a single base image with Python 3.11
FROM python:3.11-slim
# Install required packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
ca-certificates \
unzip && \
rm -rf /var/lib/apt/lists/*
# Install Deno
RUN curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 - && \
ln -s /root/.local/bin/poetry /usr/local/bin/poetry
# Set environment variables
ENV POETRY_VERSION=1.4.0
ENV POETRY_VIRTUALENVS_CREATE=false
ENV PYTHONUNBUFFERED=1
ENV DENO_INSTALL="/usr/local"
ENV PATH="${DENO_INSTALL}/bin:${PATH}"
# Set working directory for placer-service
WORKDIR /app/placer-service
# Copy only the dependency files for placer-service and install dependencies
COPY placer-service/pyproject.toml ./
# Copy the rest of the placer-service code
COPY placer-service/ ./
RUN poetry install --no-dev --no-interaction --no-ansi
# Set working directory for placer-dashboard
WORKDIR /app/placer-dashboard
# Copy Node.js dependency files and install dependencies
COPY placer-dashboard/package.json ./
COPY placer-dashboard/deno.json ./
# Cache Deno dependencies
RUN deno install --allow-scripts
RUN deno cache deno.json
# Copy the rest of the placer-dashboard code and build
COPY placer-dashboard/ ./
RUN deno task build
# Copy the entrypoint script and make it executable
COPY entrypoint.fly.sh /entrypoint.fly.sh
RUN chmod +x /entrypoint.fly.sh
ENV PLACER_SERVICE_URL="http://fly-auto-placer.internal:8080"
# Set the entrypoint
ENTRYPOINT ["/bin/sh", "/entrypoint.fly.sh"]