Skip to content

Commit

Permalink
Patch bugs in all three Docker templates (#164)
Browse files Browse the repository at this point in the history
* Ignore the correct path of compressed files, closes #145

* Use the correct yarn script name for linting, closes #154

* Use a better default for Python Docker env template, closes #99

* Remove needless line in .gitignore
  • Loading branch information
hancush committed Jan 14, 2021
1 parent db66b86 commit 5395da2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
13 changes: 9 additions & 4 deletions docker/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ as a target:
docker-compose run --rm cookiecutter -f new-django-app
```

To generate a Docker environment for an **existing Python project**,
use the `python-docker-env` directory as a target:
To generate a Docker environment for an **existing Python project**, use the
`python-docker-env` directory as a target:

```bash
docker-compose run --rm cookiecutter -f python-docker-env
Expand All @@ -43,7 +43,7 @@ in your terminal:

| Variable | Definition |
| - | - |
| `directory_name` | The directory that will contain your generated files. The default, `.`, will put the generated files in your current directory. |
| `directory_name` | The directory that will contain your generated files. We'll move the files out and remove this directory after running `cookiecutter` so it's fine to use the default here. |
| `app_name` | The slug you use to refer to your application (typically the same as the GitHub repo). |
| `app_verbose_name` | A verbose name for your application, written in plain English and typically title-case (e.g. "BGA Pensions Database"). |
| `module_name` | The slug you use to refer to the Python module that contains your app. In contrast to `app_name`, this variable must be a valid Python module name, e.g. underscores are permitted while spaces/hyphens are not. |
Expand All @@ -67,6 +67,7 @@ into the new directory and initialize it as a Git repo with `git init`:

```bash
# Replace ${directory_name} with the name of the directory you just set
# If you used the default, it's my-new-app
mv ${directory_name} ../../..
cd ../../../${directory_name} && git init
```
Expand All @@ -77,9 +78,13 @@ the repo that stores the existing project. For example:

```bash
# Replace ${directory_name} with the name of the directory you just set
mv ${directory_name}/* /path/to/existing/project
# If you used the default, it's my-docker-env
rsync -av ${directory_name}/* /path/to/existing/project && rm -rf ${directory_name}/
```

Note that this will preserve `configs/` and `scripts/` directories and their
contents, if your project already contains them.

### 4. Customize your configs and scripts.

The templated configs were written to serve our most common use cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,4 @@ venv.bak/

# Compiled JavaScript
node_modules/
{{cookiecutter.module_name}}/static/compressor/*
!{{cookiecutter.module_name}}/static/js/lib/
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ When you run `docker-compose up` locally, ESLint makes sure you're following the

If you want to check the linter on its own you can run:

`docker-compose run --rm app run lint`
`docker-compose run --rm app run test`


### 🤖 What's inside?
Expand Down
2 changes: 1 addition & 1 deletion docker/templates/python-docker-env/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"directory_name": ".",
"directory_name": "my-docker-env",
"app_name": "my-new-app",
"local_settings": "path/to/local_settings.py.example",
"run_command": "python manage.py runserver 0.0.0.0:8000",
Expand Down

0 comments on commit 5395da2

Please sign in to comment.