Compare commits

..

2 Commits

Author SHA1 Message Date
stanislav.hejny d977bc9d2b Merge pull request 'Add dev container' (#70) from feat/69 into develop
Unit test coverage / pytest (push) Failing after 2m16s
CI for pypl publish / publish-lib (push) Failing after 2m14s
/ build-and-push (push) Successful in 2m20s
Build and Publish Docker Image / build-and-push (push) Successful in 3m39s
Reviewed-on: #70
Reviewed-by: Stanislav Hejny <stanislav.hejny@cleverthis.com>
2025-08-15 14:03:42 +00:00
hurui200320 887f02fc5d feat: Add dev container
Unit test coverage / pytest (push) Failing after 2m5s
/ build-and-push (push) Successful in 2m26s
Unit test coverage / pytest (pull_request) Failing after 1m58s
ISSUE CLOSED: clevermicro/amq-adapter-python#69
2025-08-14 20:56:47 +08:00
4 changed files with 97 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
# Note: You can use any Debian/Ubuntu based image you want.
FROM mcr.microsoft.com/devcontainers/base:bullseye
# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
bash curl jq
+33
View File
@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-outside-of-docker-compose
{
"name": "Docker from Docker Compose",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use this environment variable if you need to bind mount your local source code into a new container.
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
"WORKSPACE_FOLDER": "/workspaces/${localWorkspaceFolderBasename}"
},
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "latest",
"enableNonRootDocker": "true",
"moby": "false"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.11"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
"rabbitmq:15672",
"jaeger:4317",
"jaeger:4318",
"jaeger:16686",
],
"postCreateCommand": "/bin/bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/setup.sh",
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
+53
View File
@@ -0,0 +1,53 @@
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
volumes:
# Forwards the local Docker socket to the container.
- /var/run/docker.sock:/var/run/docker-host.sock
# Update this to wherever you want VS Code to mount the folder of your project
- ../..:/workspaces:cached
# Overrides default command so things don't shut down after the process ends.
entrypoint: /usr/local/share/docker-init.sh
command: sleep infinity
# Uncomment the next four lines if you will use a ptrace-based debuggers like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
depends_on:
- rabbitmq
- jaeger
rabbitmq:
image: rabbitmq:4-management
hostname: "my-rabbit"
environment:
RABBITMQ_DEFAULT_USER: springuser
RABBITMQ_DEFAULT_PASS: TheCleverWho
volumes:
- "rabbitmq-data:/var/lib/rabbitmq"
jaeger:
image: "jaegertracing/jaeger:2.2.0"
command:
- "--config=file:/config/jaeger.yml"
volumes:
- "jaeger-data:/tmp" # This is the only folder can be used without permission issue
- "./jaeger-config.yaml:/config/jaeger.yml"
- "./jaeger-config-ui.json:/config/jaeger-config-ui.json"
environment:
- COLLECTOR_OTLP_ENABLED=true
volumes:
rabbitmq-data:
jaeger-data:
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
python3 -m pip install --upgrade pip
pip install -e .[dev]