From d2cda9c6b09f7623174c3ff05f838cbd4481e637 Mon Sep 17 00:00:00 2001 From: rodrigo Date: Fri, 21 Jun 2024 01:00:31 +0000 Subject: [PATCH] fix: reduce size of container --- .devcontainer/Dockerfile | 4 ---- .devcontainer/devcontainer.json | 7 ++++--- .devcontainer/docker-compose.yml | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2c5e820..0a93e44 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1 @@ FROM python:3.12 - -# Install python requirements -COPY backend/requirements-combined.txt requirements-combined.txt -RUN pip install -r requirements-combined.txt \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 15faabf..4dc5636 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "name": "retro_olympics", "dockerComposeFile": "docker-compose.yml", "service": "webapp", - "workspaceFolder": "/workspace", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "features": { "ghcr.io/devcontainers/features/node:1": { "nodeGypDependencies": true, @@ -23,6 +23,7 @@ }, "remoteUser": "root", "remoteEnv": { - "PYTHONPATH": "/workspace/backend/src" - } + "PYTHONPATH": "/workspaces/${localWorkspaceFolderBasename}/backend/src" + }, + "postCreateCommand": "cd backend/ && pip install -r requirements-combined.txt" } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 1f060a8..3e6c7ae 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -3,11 +3,11 @@ version: "3.8" services: webapp: build: - context: .. - dockerfile: .devcontainer/Dockerfile + context: . + dockerfile: Dockerfile entrypoint: ["tail", "-f", "/dev/null"] volumes: - - ..:/workspace + - ../..:/workspaces:cached command: sleep infinity network_mode: service:db db: