I am trying to do a batch rename of files with rename. I can execute most of my changes but one is eluding me.
I am using this
find cracking-the-coding-interview -execdir rename 'y/---/-/' '{}' \+
The idea works fine for other regex, but this replacement does nothing. I tried replacing with a different item instead of dash
y/---/a/
and it replaced every dash with an a! not just those three connected. I also tried
'y/-{3}/-/'
I have a file structure something like this:
├── cracking-the-coding-interview
│ ├── algorithms
│ │ ├── bfs---shortest-reach-in-a-graph
│ │ │ ├── description.md
│ │ │ ├── solution.java
│ │ │ └── solution.js
│ │ ├── binary-search---ice-cream-parlor
│ │ │ ├── description.md
│ │ │ └── solution.js
│ │ ├── dfs---connected-cell-in-a-grid
Related
I have been working on a C++ project which depends on RPLidar SDK. I have already installed the SDK as per the instructions in the README. (FYI: I couldn't install it in the /usr/local/ directory using sudo make install command). As per the SDK documentation:
When developing via RPLIDAR SDK, developers only need to include SDK’s
external header files (under sdk\include) into their own source code and link the
application with SDK’s static library (rplidar_driver.lib or rplidar_driver.a).
So, in my CMakeLists.txt, I have already added:
include_directories(/home/milan/rplidar_sdk/sdk/sdk/include/)
However, I couldn't find rplidar_driver.lib or rplidar_driver.h. Here, is the directory structure of the SDK:
.
├── docs
│ ├── ReleaseNote.v1.10.0.md
│ | ...
│ └── ReleaseNote.v1.9.1.md
├── LICENSE
├── README.md
├── sdk
│ ├── app
│ │ ├── frame_grabber
│ │ │ ├── AboutDlg.cpp
│ │ │ ├── AboutDlg.h
│ │ │ ├── drvlogic
│ │ │ │ ├── common.h
│ │ │ │ ├── lidarmgr.cpp
│ │ │ │ └── lidarmgr.h
│ │ │ ├── framegrabber.cpp
│ │ │ ├── framegrabber.h
│ │ │ ├── framegrabber.rc
│ │ │ ├── FreqSetDlg.cpp
│ │ │ ├── FreqSetDlg.h
│ │ │ ├── MainFrm.cpp
│ │ │ ├── MainFrm.h
│ │ │ ├── ref
│ │ │ │ └── wtl
│ │ │ │ ├── atlapp.h
│ │ │ │ ├── atlcrack.h
│ │ │ │ ├── atlctrls.h
│ │ │ │ ├── atlctrlw.h
│ │ │ │ ├── atlctrlx.h
│ │ │ │ ├── atlddx.h
│ │ │ │ ├── atldlgs.h
│ │ │ │ ├── atldwm.h
│ │ │ │ ├── atlfind.h
│ │ │ │ ├── atlframe.h
│ │ │ │ ├── atlgdi.h
│ │ │ │ ├── atlmisc.h
│ │ │ │ ├── atlprint.h
│ │ │ │ ├── atlresce.h
│ │ │ │ ├── atlres.h
│ │ │ │ ├── atlribbon.h
│ │ │ │ ├── atlscrl.h
│ │ │ │ ├── atlsplit.h
│ │ │ │ ├── atltheme.h
│ │ │ │ ├── atluser.h
│ │ │ │ ├── atlwince.h
│ │ │ │ └── atlwinx.h
│ │ │ ├── res
│ │ │ │ ├── rplidar.ico
│ │ │ │ └── Toolbar.bmp
│ │ │ ├── resource.h
│ │ │ ├── scanView.cpp
│ │ │ ├── scanView.h
│ │ │ ├── SerialSelDlg.cpp
│ │ │ ├── SerialSelDlg.h
│ │ │ ├── stdafx.cpp
│ │ │ ├── stdafx.h
│ │ │ ├── TcpChannelSelDlg.cpp
│ │ │ └── TcpChannelSelDlg.h
│ │ ├── Makefile
│ │ ├── simple_grabber
│ │ │ ├── main.cpp
│ │ │ └── Makefile
│ │ └── ultra_simple
│ │ ├── main.cpp
│ │ └── Makefile
│ ├── cross_compile.sh
│ ├── mak_common.inc
│ ├── mak_def.inc
│ ├── Makefile
│ ├── obj
│ │ └── Linux
│ │ └── Release
│ │ ├── sdk
│ │ │ └── src
│ │ │ ├── arch
│ │ │ │ └── linux
│ │ │ │ ├── net_serial.o
│ │ │ │ ├── net_socket.o
│ │ │ │ └── timer.o
│ │ │ ├── hal
│ │ │ │ └── thread.o
│ │ │ └── rplidar_driver.o
│ │ ├── simple_grabber
│ │ │ └── main.o
│ │ └── ultra_simple
│ │ └── main.o
│ ├── output
│ │ └── Linux
│ │ └── Release
│ │ ├── librplidar_sdk.a
│ │ ├── simple_grabber
│ │ └── ultra_simple
│ ├── sdk
│ │ ├── include
│ │ │ ├── rplidar_cmd.h
│ │ │ ├── rplidar_driver.h
│ │ │ ├── rplidar.h
│ │ │ ├── rplidar_protocol.h
│ │ │ └── rptypes.h
│ │ ├── Makefile
│ │ └── src
│ │ ├── arch
│ │ │ ├── linux
│ │ │ │ ├── arch_linux.h
│ │ │ │ ├── net_serial.cpp
│ │ │ │ ├── net_serial.h
│ │ │ │ ├── net_socket.cpp
│ │ │ │ ├── thread.hpp
│ │ │ │ ├── timer.cpp
│ │ │ │ └── timer.h
│ │ │ ├── macOS
│ │ │ │ ├── arch_macOS.h
│ │ │ │ ├── net_serial.cpp
│ │ │ │ ├── net_serial.h
│ │ │ │ ├── net_socket.cpp
│ │ │ │ ├── thread.hpp
│ │ │ │ ├── timer.cpp
│ │ │ │ └── timer.h
│ │ │ └── win32
│ │ │ ├── arch_win32.h
│ │ │ ├── net_serial.cpp
│ │ │ ├── net_serial.h
│ │ │ ├── net_socket.cpp
│ │ │ ├── timer.cpp
│ │ │ ├── timer.h
│ │ │ └── winthread.hpp
│ │ ├── hal
│ │ │ ├── abs_rxtx.h
│ │ │ ├── assert.h
│ │ │ ├── byteops.h
│ │ │ ├── event.h
│ │ │ ├── locker.h
│ │ │ ├── socket.h
│ │ │ ├── thread.cpp
│ │ │ ├── thread.h
│ │ │ ├── types.h
│ │ │ └── util.h
│ │ ├── rplidar_driver.cpp
│ │ ├── rplidar_driver_impl.h
│ │ ├── rplidar_driver_serial.h
│ │ ├── rplidar_driver_TCP.h
│ │ └── sdkcommon.h
│ └── workspaces
│ ├── vc10
│ │ ├── frame_grabber
│ │ │ ├── frame_grabber.vcxproj
│ │ │ └── frame_grabber.vcxproj.filters
│ │ ├── rplidar_driver
│ │ │ ├── rplidar_driver.vcxproj
│ │ │ └── rplidar_driver.vcxproj.filters
│ │ ├── sdk_and_demo.sln
│ │ ├── simple_grabber
│ │ │ ├── simple_grabber.vcxproj
│ │ │ └── simple_grabber.vcxproj.filters
│ │ └── ultra_simple
│ │ ├── ultra_simple.vcxproj
│ │ └── ultra_simple.vcxproj.filters
│ └── vc14
│ ├── frame_grabber
│ │ ├── frame_grabber.vcxproj
│ │ └── frame_grabber.vcxproj.filters
│ ├── rplidar_driver
│ │ ├── rplidar_driver.vcxproj
│ │ └── rplidar_driver.vcxproj.filters
│ ├── sdk_and_demo.sln
│ ├── simple_grabber
│ │ ├── simple_grabber.vcxproj
│ │ └── simple_grabber.vcxproj.filters
│ └── ultra_simple
│ ├── ultra_simple.vcxproj
│ └── ultra_simple.vcxproj.filters
└── tools
└── cp2102_driver
└── CP210x_Windows_Drivers.zip
Now, in my main.cpp, I have this line: #include <rplidar.h>. I can successfully run cmake .. command in the build directory of my project. However, upon running make command, it's giving me this error:
In file included from /home/milan/<project>/src/main.cpp:3:0:
/home/milan/rplidar_sdk/sdk/sdk/include/rplidar.h:38:10: fatal error: hal/types.h: No such file or directory
#include "hal/types.h"
^~~~~~~~~~~~~
compilation terminated.
CMakeFiles/<project>.dir/build.make:81: recipe for target 'CMakeFiles/<project>.dir/src/main.cpp.o' failed
make[2]: *** [CMakeFiles/<project>.dir/src/main.cpp.o] Error 1
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/<project>.dir/all' failed
make[1]: *** [CMakeFiles/<project>.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2
Here is my complete CMakeLists.txt:
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(<project>)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
include_directories(include)
include_directories(/home/milan/rplidar_sdk/sdk/sdk/include/)
add_executable(${PROJECT_NAME} src/main.cpp)
How can I fix this?
Since you already compiled the library, create an IMPORTED target that references the sdk/include and sdk/src directories as include path:
add_library(rplidar STATIC IMPORTED)
set_property(TARGET rplidar
PROPERTY IMPORTED_LOCATION /home/milan/rplidar_sdk/output/Linux/Release/librplidar_sdk.a)
target_include_directories(rplidar INTERFACE
/home/milan/rplidar_sdk/sdk/sdk/include/
/home/milan/rplidar_sdk/sdk/sdk/src/)
You may even need to add the sdk/arch/linux directory to the include path.
And now you can link that library to your main file by doing:
target_link_libraries(${PROJECT_NAME} rplidar)
If someone is directly looking for the updated CMakeLists.txt then here it is (special thanks to #Botje):
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(<project_name>)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
SET(CMAKE_CXX_FLAGS -pthread)
include_directories(include)
add_executable(${PROJECT_NAME} src/main.cpp src/another_src_file.cpp)
## RPLidar
# Update the following path variable as per the RPLidar SDK installation in your system!
set(RPLIDAR_SDK_PATH "/home/milan/rplidar_sdk/")
add_library(rplidar STATIC IMPORTED)
set_property(TARGET rplidar
PROPERTY IMPORTED_LOCATION ${RPLIDAR_SDK_PATH}/sdk/output/Linux/Release/librplidar_sdk.a)
target_include_directories(rplidar INTERFACE
${RPLIDAR_SDK_PATH}/sdk/sdk/include/
${RPLIDAR_SDK_PATH}/sdk/sdk/src/)
target_link_libraries(${PROJECT_NAME} rplidar)
Note: First, you have to build rplidar_sdk
I am new to the chef I could not understand what is an issue. Following is my default script
apt_update 'Update the apt cache daily' do
frequency 86_400
action :periodic
end
package 'apache2'
service 'apache2' do
supports status: true
action [:enable, :start]
end
template '/var/www/html/index.html' do
source 'index.html.erb'
end
this is the error I am getting
[2020-04-25T12:57:00+00:00] FATAL: Stacktrace dumped to /home/vagrant/.chef/local-mode-cache/cache/chef-stacktrace.out
[2020-04-25T12:57:00+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-04-25T12:57:00+00:00] FATAL: Chef::Exceptions::FileNotFound: template[/var/www/html/index.html] (learn_chef_apache2::default line 18) had an error: Chef::Exceptions::FileNotFound: Cookbook 'learn_chef_apache2' (0.1.0) does not contain a file at any of these locations:
templates/host-vagrant.vm/index.html.erb
templates/ubuntu-18.04/index.html.erb
templates/ubuntu/index.html.erb
templates/default/index.html.erb
templates/index.html.erb
and this is my cookbooks tree
cookbooks
├── learn_chef_apache2
│ ├── Berksfile
│ ├── CHANGELOG.md
│ ├── chefignore
│ ├── LICENSE
│ ├── metadata.rb
│ ├── README.md
│ ├── recipes
│ │ └── default.rb
│ ├── spec
│ │ ├── spec_helper.rb
│ │ └── unit
│ │ └── recipes
│ │ └── default_spec.rb
│ └── test
│ └── integration
│ └── default
│ └── default_test.rb
├── learn_chef_appache2
│ └── templates
│ ├── default
│ └── index.html.erb
└── templates
└── index.html.erb
Can someone please help me what wrong I am doing and it will be great if you can share a link or explain it for my understanding.
what I did wrong was my template was created outside learn_chef_apache2 whereas it should be inside as follwing
cookbooks
└── learn_chef_apache2
├── Berksfile
├── CHANGELOG.md
├── chefignore
├── index.html.erb
├── LICENSE
├── metadata.rb
├── README.md
├── recipes
│ └── default.rb
├── spec
│ ├── spec_helper.rb
│ └── unit
│ └── recipes
│ └── default_spec.rb
├── templates
│ └── index.html.erb
└── test
└── integration
└── default
└── default_test.rb
the main language is English for my website, some tutorials suggest to use django-admin makemessages -a
and others suggest to use django-admin makemessages -l -de
but when i use -a it make the en-us directory as shown below and it seems pretty much useless or is it?
it there any merit for having a en-us directory for a website with English as it's main Lang?
or should i just delete it?
.
├── db.sqlite3
├── some_industry
├── locale
│ ├── en_us
│ │ └── LC_MESSAGES
│ │ └── django.po
│ └── de
│ └── LC_MESSAGES
│ └── django.po
├── machine_request
│ ├── __init__.py
│ ├── admin.py
│ ├── locale
│ │ ├── en_us
│ │ │ └── LC_MESSAGES
│ │ │ └── django.po
│ │ └── de
│ │ └── LC_MESSAGES
│ │ └── django.po
│ ├── migrations
│ ├── static
│ │ └── machine_request
│ ├── templates
│ ├── urls.py
├── manage.py
└── users
├── __init__.py
├── admin.py
├── locale
│ ├── en_us
│ └── de
└── views.py
As far as I get this, you could use different language than english in your msgid, for example, you could use Russian msgid and English msgstr.
If you're using pretty standard option - english msgid and msgstr in German and you have German language website (no english), feel free to remove en_US directory.
I'm trying to exclude files form being watched besides folder app in watchOptions in ESLint.
My folder structure looks like:
├── assets
│ ├── assets
│ │ └── fonts
│ │ ├── FeatherIcons
│ │ ├── Icomoon
│ │ └── Montserrat
│ ├── images
│ ├── imagesNotOptimized
│ ├── js
│ │ ├── app
│ │ │ ├── api
│ │ │ │ ├── erpFlex
I would like to include all the files inside app but ignore all other files.
config.watchOptions = {
poll: true,
ignored: [
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, 'assets/js/*!(app)'),
]
};
I have tried the following regexes
assets/js/*(!app)
assets/js/(?!app)
Nothing seems to work. Any help would be much appreciated. Thank you
EDIT
I have been able to match the string using the following regex: https://regex101.com/r/hs4lOt/1
but path.resolve(__dirname, 'assets/js/(?!app).*') is not working which makes this question not about regex but why ignored is not working in watchOptions
I developed locally using Docker and cookiecutter-django.
Cookiecutter-django creates several Dockerfiles within the "compose" directory.
I am now trying to push the project to Heroku.
However, heroku container:push web will return No images to push.
If I try the same command within a subdirectory of the compose directory, it will eventually break--probably due to an attempt at only pushing partial dockerfiles.
How do I get this up and running on Heroku taking advantage of Heroku containers?
This article from Heroku says I can push multiple images using by renaming the Dockerfiles, but I'm not sure how to figure out which of these cookiecutter-generated Dockerfiles are of which process type.
docker images will return:
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 16e570f295a7 10 minutes ago 318MB
luup_celeryworker latest bd7ff7e5eb10 2 hours ago 531MB
luup_django latest bd7ff7e5eb10 2 hours ago 531MB
luup_celerybeat latest bd7ff7e5eb10 2 hours ago 531MB
luup_postgres latest e50eb7b8a704 2 hours ago 287MB
registry.heroku.com/fierce-forest-57627/web latest 27690b3e49d4 16 hours ago 766MB
python 3.6-alpine c3a4a35c9244 22 hours ago 90MB
This is the Dockerfile made by cookiecutter. It is the DF under compose/production/django. There are other DFs--for caddy, postgres, as well as DFs for local.
FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1
RUN apk update \
# psycopg2 dependencies
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
# Pillow dependencies
&& apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
# CFFI dependencies
&& apk add libffi-dev openssl-dev py-cffi
RUN addgroup -S django \
&& adduser -S -G django django
# Requirements have to be pulled and installed here, otherwise caching won't work
COPY ./requirements /requirements
RUN pip install --no-cache-dir -r /requirements/production.txt \
&& rm -rf /requirements
COPY ./compose/production/django/gunicorn.sh /gunicorn.sh
RUN sed -i 's/\r//' /gunicorn.sh
RUN chmod +x /gunicorn.sh
RUN chown django /gunicorn.sh
COPY ./compose/production/django/entrypoint.sh /entrypoint.sh
RUN sed -i 's/\r//' /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chown django /entrypoint.sh
COPY ./compose/production/django/celery/worker/start.sh /start-celeryworker.sh
RUN sed -i 's/\r//' /start-celeryworker.sh
RUN chmod +x /start-celeryworker.sh
COPY ./compose/production/django/celery/beat/start.sh /start-celerybeat.sh
RUN sed -i 's/\r//' /start-celerybeat.sh
RUN chmod +x /start-celerybeat.sh
COPY . /app
RUN chown -R django /app
USER django
WORKDIR /app
ENTRYPOINT ["/entrypoint.sh"]
Please let me know if you need any more information
Edit--adding tree:
note: I've renamed the Dockerfiles to Dockerfile.processtype as instructed by Heroku here--Although I'm no longer pushing multiple images.. As you can tell in the tree, I've also moved a copy of Dockerfile.django and Dockerfile.local to the root of the project, as that's where it needs to be in order to Heroku container:push processtype --recursive.
├── Dockerfile.django
├── Dockerfile.local
├── LICENSE
├── Procfile
├── README.rst
├── compose
│ ├── local
│ │ └── django
│ │ ├── celery
│ │ │ ├── beat
│ │ │ │ └── start.sh
│ │ │ └── worker
│ │ │ └── start.sh
│ │ └── start.sh
│ └── production
│ ├── caddy
│ │ ├── Caddyfile
│ │ └── Dockerfile.caddy
│ ├── django
│ │ ├── Dockerfile.django
│ │ ├── celery
│ │ │ ├── beat
│ │ │ │ └── start.sh
│ │ │ └── worker
│ │ │ └── start.sh
│ │ ├── entrypoint.sh
│ │ └── gunicorn.sh
│ └── postgres
│ ├── Dockerfile.postgres
│ └── maintenance
│ ├── _sourced
│ │ ├── constants.sh
│ │ ├── countdown.sh
│ │ ├── messages.sh
│ │ └── yes_no.sh
│ ├── backup
│ ├── backups
│ └── restore
├── config
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-35.pyc
│ │ ├── __init__.cpython-36.pyc
│ │ ├── urls.cpython-36.pyc
│ │ └── wsgi.cpython-36.pyc
│ ├── settings
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-35.pyc
│ │ │ ├── __init__.cpython-36.pyc
│ │ │ ├── base.cpython-35.pyc
│ │ │ ├── base.cpython-36.pyc
│ │ │ ├── local.cpython-35.pyc
│ │ │ ├── local.cpython-36.pyc
│ │ │ └── production.cpython-36.pyc
│ │ ├── base.py
│ │ ├── local.py
│ │ ├── production.py
│ │ └── test.py
│ ├── urls.py
│ └── wsgi.py
├── docs
│ ├── Makefile
│ ├── __init__.py
│ ├── conf.py
│ ├── deploy.rst
│ ├── docker_ec2.rst
│ ├── index.rst
│ ├── install.rst
│ └── make.bat
├── heroku.yml
├── local.yml
├── locale
│ └── README.rst
├── lurnup
│ ├── __init__.py
│ ├── __pycache__
│ │ └── __init__.cpython-36.pyc
│ ├── contrib
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ └── __init__.cpython-36.pyc
│ │ └── sites
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ └── __init__.cpython-36.pyc
│ │ └── migrations
│ │ ├── 0001_initial.py
│ │ ├── 0002_alter_domain_unique.py
│ │ ├── 0003_set_site_domain_and_name.py
│ │ ├── __init__.py
│ │ └── __pycache__
│ │ ├── 0001_initial.cpython-36.pyc
│ │ ├── 0002_alter_domain_unique.cpython-36.pyc
│ │ ├── 0003_set_site_domain_and_name.cpython-36.pyc
│ │ └── __init__.cpython-36.pyc
│ ├── static
│ │ ├── css
│ │ │ └── project.css
│ │ ├── fonts
│ │ ├── images
│ │ │ └── favicon.ico
│ │ ├── js
│ │ │ └── project.js
│ │ └── sass
│ │ ├── custom_bootstrap_vars.scss
│ │ └── project.scss
│ ├── taskapp
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-36.pyc
│ │ │ └── celery.cpython-36.pyc
│ │ └── celery.py
│ ├── templates
│ │ ├── 403_csrf.html
│ │ ├── 404.html
│ │ ├── 500.html
│ │ ├── account
│ │ │ ├── account_inactive.html
│ │ │ ├── base.html
│ │ │ ├── email.html
│ │ │ ├── email_confirm.html
│ │ │ ├── login.html
│ │ │ ├── logout.html
│ │ │ ├── password_change.html
│ │ │ ├── password_reset.html
│ │ │ ├── password_reset_done.html
│ │ │ ├── password_reset_from_key.html
│ │ │ ├── password_reset_from_key_done.html
│ │ │ ├── password_set.html
│ │ │ ├── signup.html
│ │ │ ├── signup_closed.html
│ │ │ ├── verification_sent.html
│ │ │ └── verified_email_required.html
│ │ ├── base.html
│ │ ├── pages
│ │ │ ├── about.html
│ │ │ └── home.html
│ │ └── users
│ │ ├── user_detail.html
│ │ ├── user_form.html
│ │ └── user_list.html
│ └── users
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-36.pyc
│ │ ├── adapters.cpython-36.pyc
│ │ ├── admin.cpython-36.pyc
│ │ ├── apps.cpython-36.pyc
│ │ ├── models.cpython-36.pyc
│ │ ├── urls.cpython-36.pyc
│ │ └── views.cpython-36.pyc
│ ├── adapters.py
│ ├── admin.py
│ ├── apps.py
│ ├── migrations
│ │ ├── 0001_initial.py
│ │ ├── __init__.py
│ │ └── __pycache__
│ │ ├── 0001_initial.cpython-36.pyc
│ │ └── __init__.cpython-36.pyc
│ ├── models.py
│ ├── tests
│ │ ├── __init__.py
│ │ ├── factories.py
│ │ ├── test_admin.py
│ │ ├── test_models.py
│ │ ├── test_urls.py
│ │ └── test_views.py
│ ├── urls.py
│ └── views.py
├── manage.py
├── merge_production_dotenvs_in_dotenv.py
├── production.yml
├── pytest.ini
├── requirements
│ ├── base.txt
│ ├── local.txt
│ └── production.txt
Cookiecutter-django provides a standard docker compose configuration that you can push on several hosting services with full Docker support.
However, Heroku supports Docker with a few restrictions. For instance, the port for the WSGI server is hardcoded to 5000, where Heroku requires to use the environment variable $PORT.
These are NOT accounted for in cookiecutter-django, so you will have to change a few things:
I'd start with the images in compose/production/django and ignore the DB (prvided via add-on) and Caddy (see here instead).
Change the Gunicorn port from 5000 to $PORT
The code to get DATABASE_URL in entrypoint.sh should probably not be needed.
Last but not least: create a heroku.yml file to point at the DF you want to use.
With docker-compose, you can re-use the same Dockerfile and change the entrypoint, but I don't think it's feasible with Heroku. You might need to create a duplicate the web Dockerfile and change it for your Celery dynos.
I've tried Docker on Heroku, but not with cookiecutter-django' setup. The Heroku way is not standard enough IMO, it's a bit of a middle ground between pure Heroku and bare Docker.
Hope that helps!