Skip to content

Commit 2448409

Browse files
Added devcontainer configuration for development
1 parent 9f806b3 commit 2448409

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
####
2+
# Build stage 0:
3+
# - Install apt build dependencies
4+
# - Make venv and install requirements
5+
#
6+
7+
FROM python:3.10-bookworm AS base-builder
8+
9+
# zentral apt dependencies
10+
RUN apt-get update && \
11+
apt-get autoremove -y && \
12+
apt-get install -y --no-install-recommends \
13+
# extra dependencies for python crypto / WebAuthn
14+
libssl-dev \
15+
libffi-dev \
16+
python3-dev \
17+
# dep for psycopg2
18+
libpq-dev \
19+
# dep for python-ldap
20+
libldap2-dev \
21+
libsasl2-dev \
22+
# dep to build the css and js dist files
23+
npm && \
24+
# clean cache
25+
rm -rf /var/lib/apt/lists/*
26+
27+
# Create a virtualenv and use it
28+
RUN python -m venv /opt/venv && /opt/venv/bin/pip install -U pip setuptools wheel
29+
ENV PATH="/opt/venv/bin:$PATH"
30+
31+
COPY constraints.txt requirements*.txt ./
32+
RUN pip install -r requirements.txt -r requirements_dev.txt -r requirements_aws.txt -r requirements_gcp.txt
33+
34+
# Build the CSS and JS dist files
35+
COPY package.json package-lock.json webpack.config.js ./
36+
COPY server/static_src ./server/static_src
37+
RUN npm install && npm run build

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Zentral Default Dev Environment",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": ".."
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-python.python",
11+
"ms-python.flake8"
12+
]
13+
}
14+
}
15+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ __pycache__
88
!/.gitignore
99
!/.dockerignore
1010
!/.github
11+
!/.devcontainer
1112

1213
/venv/
1314

0 commit comments

Comments
 (0)