Skip to content

Commit

Permalink
Readd Dockerfile and add trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Antony Bailey authored and Antony Bailey committed Apr 26, 2024
1 parent b4103c3 commit 26f12f9
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
2 changes: 2 additions & 0 deletions .trunk/configs/.isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
7 changes: 7 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
5 changes: 5 additions & 0 deletions .trunk/configs/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generic, formatter-friendly config.
select = ["B", "D3", "E", "F"]

# Never enforce `E501` (line length violations). This should be handled by formatters.
ignore = ["E501"]
38 changes: 38 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.22.0
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.5.0
uri: https://github.com/trunk-io/plugins
actions:
disabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
enabled:
- trunk-upgrade-available
runtimes:
enabled:
- node@18.12.1
- python@3.10.8
lint:
enabled:
- actionlint@1.6.27
- bandit@1.7.8
- black@24.4.2
- checkov@3.2.74
- git-diff-check
- isort@5.13.2
- osv-scanner@1.7.2
- prettier@3.2.5
- renovate@37.324.0
- ruff@0.4.2
- tflint@0.50.3
- trivy@0.50.4
- trufflehog@3.74.0
- yamllint@1.35.1
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use official Python runtime as a parent image
FROM python:3.12-slim

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed dependencies specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Define environment variable
ENV PYTHONUNBUFFERED=1

# Add standard labels
LABEL maintainer="Joshua Clarke and Antony Bailey <antony.bailey@thepoliceoftheinter.net>"
LABEL description="This is a Docker image for the Hammy McHamilton Discord Bot."
LABEL org.opencontainers.image.created="$BUILD_DATE"
# docker build --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t hammy-mchamilton .

# Run main.py when the container launches
CMD ["python", "main.py"]

0 comments on commit 26f12f9

Please sign in to comment.