Skip to content

Commit

Permalink
Merge pull request #3 from falsepopsky/dev
Browse files Browse the repository at this point in the history
feat: add Node.js to devcontainer and reduce size
  • Loading branch information
falsepopsky authored Jun 21, 2024
2 parents 6050333 + d2cda9c commit 533d0f4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
4 changes: 0 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
27 changes: 12 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
{
"name": "retro_olympics_webapp",
"name": "retro_olympics",
"dockerComposeFile": "docker-compose.yml",
"workspaceFolder": "/workspace",
"service": "webapp",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "20.15.0",
"nvmVersion": "latest"
}
},
"customizations": {
"vscode": {
"settings": {
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
}
},
"isort.args": ["--profile", "black"],
"ruff.nativeServer": true
},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
Expand All @@ -27,6 +23,7 @@
},
"remoteUser": "root",
"remoteEnv": {
"PYTHONPATH": "/workspace/backend/src"
}
"PYTHONPATH": "/workspaces/${localWorkspaceFolderBasename}/backend/src"
},
"postCreateCommand": "cd backend/ && pip install -r requirements-combined.txt"
}
21 changes: 15 additions & 6 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
version: "3.8"

services:
webapp:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
context: .
dockerfile: Dockerfile
entrypoint: ["tail", "-f", "/dev/null"]
volumes:
- ..:/workspace
postgres:
image: "postgres:16"
- ../..:/workspaces:cached
command: sleep infinity
network_mode: service:db
db:
image: postgres:16-alpine
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_HOST_AUTH_METHOD: trust

volumes:
postgres-data:
11 changes: 10 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@
"eslint.workingDirectories": ["frontend"],
"eslint.validate": ["typescript", "typescriptreact"],
"typescript.tsdk": "./frontend/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
"typescript.enablePromptUseWorkspaceTsdk": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
}
},
"isort.args": ["--profile", "black"],
"ruff.nativeServer": true
}
2 changes: 1 addition & 1 deletion frontend/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.14.0
v20.15.0

0 comments on commit 533d0f4

Please sign in to comment.