Adds dev tools docker image

This commit is contained in:
Mouse Reeve 2022-02-12 14:06:18 -08:00
parent 1a2c85a327
commit b601ac6f91
6 changed files with 26 additions and 6 deletions

10
bw-dev
View file

@ -35,7 +35,7 @@ function initdb {
} }
function makeitblack { function makeitblack {
runweb black celerywyrm bookwyrm docker-compose run --rm dev-tools black celerywyrm bookwyrm
} }
function awscommand { function awscommand {
@ -135,15 +135,15 @@ case "$CMD" in
makeitblack makeitblack
;; ;;
prettier) prettier)
npx prettier --write bookwyrm/static/js/*.js docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js
;; ;;
stylelint) stylelint)
npx stylelint bookwyrm/static/**/*.css --fix docker-compose run --rm dev-tools npx stylelint bookwyrm/static/**/*.css --fix
;; ;;
formatters) formatters)
makeitblack makeitblack
npx prettier --write bookwyrm/static/js/*.js docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js
npx stylelint bookwyrm/static/**/*.css --fix docker-compose run --rm dev-tools npx stylelint bookwyrm/static/**/*.css --fix
;; ;;
update) update)
git pull git pull

View file

@ -0,0 +1,15 @@
FROM python:3.9
ENV PYTHONUNBUFFERED 1
RUN mkdir /app /app/static /app/images
WORKDIR /app
COPY package.json requirements.txt /app/
RUN pip install black
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y nodejs
RUN npm install .

View file

@ -0,0 +1 @@
black==21.4b2

View file

@ -84,6 +84,11 @@ services:
- db - db
- redis_broker - redis_broker
restart: on-failure restart: on-failure
dev-tools:
build: dev-tools-docker
env_file: .env
volumes:
- .:/app
volumes: volumes:
pgdata: pgdata:
static_volume: static_volume:

View file

@ -25,7 +25,6 @@ opentelemetry-instrumentation-django==0.27b0
opentelemetry-instrumentation-celery==0.27b0 opentelemetry-instrumentation-celery==0.27b0
# Dev # Dev
black==21.4b2
pytest-django==4.1.0 pytest-django==4.1.0
pytest==6.1.2 pytest==6.1.2
pytest-cov==2.10.1 pytest-cov==2.10.1