fix(docker): optimize backend build with explicit COPY and updated .dockerignore
This commit is contained in:
parent
17b645325c
commit
4ed5fd8dc4
|
|
@ -1,8 +1,19 @@
|
|||
frontend/
|
||||
velxio/
|
||||
flowchart/
|
||||
compiler_worker/
|
||||
velxio-deployer-firmware/
|
||||
load-test/
|
||||
.browser-test/
|
||||
.pytest_cache/
|
||||
.git/
|
||||
__pycache__/
|
||||
*.pyc
|
||||
state/
|
||||
config/
|
||||
documentation.md
|
||||
podman-compose.yml
|
||||
podman-compose.velxio.yml
|
||||
lms-c-precompiled.tar
|
||||
.dockerignore
|
||||
|
||||
|
|
|
|||
13
Dockerfile
13
Dockerfile
|
|
@ -15,11 +15,16 @@ WORKDIR /app
|
|||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
# Copy backend application code only with non-root ownership
|
||||
COPY --chown=app:app app.py config.py extensions.py gunicorn.conf.py alembic.ini pytest.ini ./
|
||||
COPY --chown=app:app routes/ ./routes/
|
||||
COPY --chown=app:app services/ ./services/
|
||||
COPY --chown=app:app scripts/ ./scripts/
|
||||
COPY --chown=app:app migrations/ ./migrations/
|
||||
COPY --chown=app:app docs/ ./docs/
|
||||
COPY --chown=app:app help/ ./help/
|
||||
COPY --chown=app:app compiler/ ./compiler/
|
||||
|
||||
# Change ownership to the app user
|
||||
RUN chown -R app:app /app
|
||||
USER app
|
||||
|
||||
# Expose port 5000
|
||||
|
|
|
|||
Loading…
Reference in New Issue