Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up devcontainer build #158

Merged
merged 1 commit into from
Nov 18, 2023
Merged
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
14 changes: 2 additions & 12 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@ FROM mcr.microsoft.com/devcontainers/jekyll:2-bullseye
LABEL org.opencontainers.image.source https://github.com/oleksis/blackpythondevs.com
LABEL org.opencontainers.image.description "Black Python Developers website."

ARG PYTHON_VERSION="3.11.6"
ENV VERSION=${PYTHON_VERSION}

USER root

ADD --chmod=0755 https://github.com/devcontainers/features/main/src/python/install.sh /tmp/
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& /tmp/install.sh

COPY requirements-dev.txt /tmp/requirements-dev.txt
RUN /usr/local/python/${PYTHON_VERSION}/bin/python3 -m pip install --no-cache-dir -r /tmp/requirements-dev.txt \
&& /usr/local/python/${PYTHON_VERSION}/bin/python3 -m playwright install --with-deps

COPY --chmod=0755 .devcontainer/post-create-bpdevs.sh /usr/local/post-create-bpdevs.sh

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && rm -rf /var/lib/apt/lists/*

EXPOSE 4000/tcp
13 changes: 7 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
// "ghcr.io/devcontainers/features/python:1": {
// "version": "3.11"
// },
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
"ghcr.io/devcontainers/features/docker-in-docker": {},
"ghcr.io/devcontainers-contrib/features/act:1": {}
"ghcr.io/devcontainers/features/python:1": {
"version": "3.11"
},
"ghcr.io/oleksis/devcontainer-features/python-launcher:latest": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {}
// "ghcr.io/devcontainers/features/docker-in-docker": {},
// "ghcr.io/devcontainers-contrib/features/act:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/post-create-bpdevs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh

pre-commit install
py -m pip install --no-cache-dir -r /tmp/requirements-dev.txt
py -m playwright install --with-deps
Loading