-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.Dockerfile
More file actions
31 lines (25 loc) · 867 Bytes
/
database.Dockerfile
File metadata and controls
31 lines (25 loc) · 867 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
# Use the official Python base image
FROM python:3.12.3-slim-bookworm
# Set the working directory in the container
WORKDIR /app
# Copy the Poetry configuration files to the working directory
COPY database/pyproject.toml .
# Install Poetry
RUN pip install poetry
# Install project dependencies using Poetry
RUN poetry config virtualenvs.create false \
&& poetry install
# Copy the application code to the working directory
COPY database .
# Run the Flask server and checking for data directory and running make if necessary
CMD apt-get update && \
apt-get install -y make wget && \
echo "Checking data directory..." && \
ls -l data && \
if [ ! -d "data" ] || [ -z "$(ls -A data)" ]; then \
echo "Running make..." && \
make; \
else \
echo "Data directory exists and is not empty"; \
fi && \
python server.py