-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 938 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 938 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
# 1) Build stage: install the package into a clean image
FROM python:3.9-slim AS builder
LABEL org.opencontainers.image.source="https://github.com/hoangsonww/SQL-Mongo-Query-Converter"
LABEL org.opencontainers.image.description="sql_mongo_converter: convert SQL ↔ MongoDB queries."
WORKDIR /app
# copy only what's needed to install
COPY setup.py README.md ./
COPY sql_mongo_converter/ ./sql_mongo_converter/
# install package (and cache dependencies)
RUN pip install --no-cache-dir .
# 2) Final runtime image
FROM python:3.9-slim
WORKDIR /app
# copy installed package from builder
COPY --from=builder /usr/local/lib/python3.9/site-packages/sql_mongo_converter* \
/usr/local/lib/python3.9/site-packages/
# copy any entrypoint script if you have one, or just expose it
# e.g. an entrypoint.py that calls your package
# COPY entrypoint.py ./
# default command: show help
CMD ["python", "-m", "sql_mongo_converter", "--help"]