Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .devcontainer/docker-compose.devcontainer.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
services:
django:
# Don't expose ports, devcontainer forwarding is superior, since we can just bind to localhost.
ports: !reset []
# Don't auto-run the default command, launch.json or the terminal will be used.
command: !reset []

Expand Down
12 changes: 12 additions & 0 deletions dev/django.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ ENV TOX_WORK_DIR=/home/vscode/tox \
RUFF_CACHE_DIR=/home/vscode/.cache/ruff \
MYPY_CACHE_DIR=/home/vscode/.cache/mypy

# Match the container's vscode user to the host user's uid/gid, so bind-mounted
# files created in the container are owned by the host user. Values come from
# USER_UID/USER_GID build args (see docker-compose.override.yml), which default
# to the base image's own vscode uid/gid, making this a no-op by default.
ARG USER_UID=1000
ARG USER_GID=1000
RUN if [ "$USER_UID" != "1000" ] || [ "$USER_GID" != "1000" ]; then \
groupmod --gid "$USER_GID" vscode && \
usermod --uid "$USER_UID" --gid "$USER_GID" vscode && \
chown --recursive vscode:vscode /home/vscode; \
fi

RUN ["chsh", "-s", "/usr/bin/zsh", "vscode"]

USER vscode
Expand Down
8 changes: 7 additions & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ services:
build:
context: .
dockerfile: ./dev/django.Dockerfile
args:
USER_UID: ${USER_UID:-1000}
USER_GID: ${USER_GID:-1000}
command: [
"./manage.py",
"runserver_plus", "0.0.0.0:8000"
Expand All @@ -16,7 +19,7 @@ services:
- ${ROSS_PATH:-../ross}:/home/vscode/ross
- pkg_cache:/home/vscode/pkg-cache
ports:
- 8000:8000
- "127.0.0.1:8000:8000"
depends_on:
postgres:
condition: service_healthy
Expand All @@ -29,6 +32,9 @@ services:
build:
context: .
dockerfile: ./dev/django.Dockerfile
args:
USER_UID: ${USER_UID:-1000}
USER_GID: ${USER_GID:-1000}
command: [
"uv", "run",
"celery",
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
start_period: 30s
start_interval: 2s
ports:
- 5432:5432
- "127.0.0.1:5432:5432"
volumes:
- postgres:/var/lib/postgresql

Expand All @@ -21,8 +21,8 @@ services:
start_period: 30s
start_interval: 2s
ports:
- 5672:5672
- 15672:15672
- "127.0.0.1:5672:5672"
- "127.0.0.1:15672:15672"
volumes:
- rabbitmq:/var/lib/rabbitmq

Expand All @@ -41,8 +41,8 @@ services:
start_period: 30s
start_interval: 2s
ports:
- 9000:9000
- 9001:9001
- "127.0.0.1:9000:9000"
- "127.0.0.1:9001:9001"
volumes:
- minio:/data

Expand Down