@@ -35,10 +35,10 @@ LABEL org.opencontainers.image.source="https://github.com/nanotaboada/python-sam
3535
3636# Copy metadata docs for container registries (e.g.: GitHub Container Registry)
3737COPY README.md ./
38- COPY assets ./assets
38+ COPY assets/ ./assets/
3939
4040# Copy pre-built wheels from builder
41- COPY --from=builder /app/wheelhouse /app/wheelhouse
41+ COPY --from=builder /app/wheelhouse/ /app/wheelhouse/
4242
4343# Install dependencies
4444COPY requirements.txt .
@@ -47,19 +47,21 @@ RUN pip install --no-cache-dir --no-index --find-links /app/wheelhouse -r requir
4747
4848# Copy application source code
4949COPY main.py ./
50- COPY databases ./databases
51- COPY models ./models
52- COPY routes ./routes
53- COPY schemas ./schemas
54- COPY services ./services
50+ COPY databases/ ./databases/
51+ COPY models/ ./models/
52+ COPY routes/ ./routes/
53+ COPY schemas/ ./schemas/
54+ COPY services/ ./services/
5555
5656# https://rules.sonarsource.com/docker/RSPEC-6504/
5757
5858# Copy entrypoint and healthcheck scripts
5959COPY --chmod=755 scripts/entrypoint.sh ./entrypoint.sh
6060COPY --chmod=755 scripts/healthcheck.sh ./healthcheck.sh
61- # Copy pre-seeded SQLite database as init bundle
62- COPY --chmod=755 storage ./docker-compose
61+ # The 'hold' is our storage compartment within the image. Here, we copy a
62+ # pre-seeded SQLite database file, which Compose will mount as a persistent
63+ # 'storage' volume when the container starts up.
64+ COPY --chmod=755 storage/ ./hold/
6365
6466# Add non-root user and make volume mount point writable
6567RUN adduser --system --disabled-password --group fastapi && \
@@ -68,7 +70,6 @@ RUN adduser --system --disabled-password --group fastapi && \
6870
6971ENV PYTHONUNBUFFERED=1
7072
71- # Drop privileges
7273USER fastapi
7374
7475EXPOSE 9000
0 commit comments