Skip to content

Commit 5087cc1

Browse files
committed
Make git so it works in a dev container
1 parent 59a6fba commit 5087cc1

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
// The optional 'workspaceFolder' property is the path VS Code should open by default when
1818
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
1919
"workspaceFolder": "/srv/app/",
20+
21+
// Prevent the the "Git: fatal: detected dubious ownership in repository" error
22+
"postStartCommand": "git config --global --add safe.directory /srv/app",
23+
2024
"customizations": {
2125
"vscode": {
2226
"extensions": [

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ htmlcov
1313
latest.dump
1414
node_modules
1515
public/static/dist
16+
*.pyc
17+
__pycache__/
18+
.DS_Store

config/docker/Dockerfile.web

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN set -ex \
2727
# ------------------------------------------------------------
2828
# STAGE 2: Dev layer
2929
# ------------------------------------------------------------
30-
FROM python:3-slim-buster as dev
30+
FROM mcr.microsoft.com/devcontainers/python:3.11-bullseye as dev
3131

3232
# Set the locale
3333
# libxml2-dev is needed for uwsgi in the production stage
@@ -52,7 +52,7 @@ ENV LANG=en_US.UTF-8 \
5252
WORKDIR /srv/app
5353

5454
RUN set -ex \
55-
&& groupadd -r app && useradd --uid=1000 --create-home --home-dir=/home/app --no-log-init -r -g app app \
55+
&& groupadd -r app && useradd --uid=2000 --create-home --home-dir=/home/app --no-log-init -r -g app app \
5656
&& echo "\nsource ./config/bash/bashrc" >> /home/app/.bashrc
5757

5858
COPY --from=python-requirements --chown=app:app $VIRTUAL_ENV $VIRTUAL_ENV

0 commit comments

Comments
 (0)