Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit 4cccc31

Browse files
authored
Add devcontainer config (#69)
1 parent 65aa17f commit 4cccc31

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

.devcontainer/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ARG VARIANT="3"
2+
3+
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
4+
5+
ARG POETRY_VERSION="1.3.1"
6+
ARG POETRY_SRC="https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py"
7+
8+
RUN apt-get update \
9+
&& apt-get install -y ca-certificates curl gnupg lsb-release \
10+
&& mkdir -p /etc/apt/keyrings \
11+
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
12+
| gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
13+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable" \
14+
| tee /etc/apt/sources.list.d/docker.list > /dev/null \
15+
&& apt-get update \
16+
&& apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
17+
18+
RUN usermod -aG docker vscode
19+
20+
USER vscode
21+
WORKDIR /home/vscode
22+
23+
RUN curl -fsSL -o install-poetry.py "${POETRY_SRC}" \
24+
&& python install-poetry.py --version $POETRY_VERSION \
25+
&& rm install-poetry.py
26+
27+
RUN mkdir -p .config/git \
28+
&& echo ".vscode/*" >> .config/git/ignore \
29+
&& echo "*.code-workspace" >> .config/git/ignore \
30+
&& echo ".history/" >> .config/git/ignore

.devcontainer/devcontainer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "Python",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"POETRY_VERSION": "1.3.1",
7+
"VARIANT": "3.10"
8+
}
9+
},
10+
"hostRequirements": {
11+
"memory": "8gb"
12+
},
13+
"remoteEnv": {
14+
"POETRY_VIRTUALENVS_IN_PROJECT": "true",
15+
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin"
16+
},
17+
"extensions": [
18+
"ms-vsliveshare.vsliveshare",
19+
"ms-azuretools.vscode-docker",
20+
"ms-python.python",
21+
"EditorConfig.EditorConfig"
22+
],
23+
"runArgs": ["--volume=/var/lib/docker", "--privileged"],
24+
"postCreateCommand": "sudo service docker start && poetry install",
25+
"remoteUser": "vscode"
26+
}

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SeamBackend:
2727
# dramatically reduce test time to switch
2828
@pytest.fixture(scope="function")
2929
def seam_backend():
30-
with PostgresContainer("postgres:13", dbname="postgres") as pg:
30+
with PostgresContainer("postgres:15", dbname="postgres") as pg:
3131
db_host = pg.get_container_host_ip()
3232
db_url = pg.get_connection_url()
3333

0 commit comments

Comments
 (0)