lebriton/ihatetobudget

Error with top level object in ./docker-compose.yml

funkyguy4000 opened this issue · 2 comments

After cloning and following all the instructions on the README, I'm hitting this issue:
ERROR: Top level object in './docker-compose.yml' needs to be an object not '<class 'str'>'.

After looking into the docker-compose.yml file, I verified the secret key I put in the docker-compose.env is the same one my docker-compose.yml. It is worth mentioning that I'm running on a raspberry pi 4 running Raspberry Pi OS.

Is there something else I should look into? I don't yet know how to build docker containers so any kind of update or instructions would be very helpful.

Tbh, I don't know what went wrong.

After looking into the docker-compose.yml file, I verified the secret key I put in the docker-compose.env is the same one my docker-compose.yml.

I don't quite understand. Did you modify docker-compose.yml? Normally there is no reason to modify docker-compose.yml (except maybe to modify the ports). The only settings to customize are in docker-compose.env.

Can you provide the diff between docker-compose.yml.example and docker-compose.yml, i.e.:

diff -u docker-compose.yml.example docker-compose.yml

Figured it out!
I must have forgotten to change the source file extensions for when I copied the files over from their example counterparts. I was wondering why the .yml file looked so much like the .env. originally. I've re-copied them following the instructions and it looks like things are running well.

I pasted the diff below just for completeness.

pi@raspberrypi:~/ihatetobudget $ diff -u docker-compose.yml.example docker-compose.yml
--- docker-compose.yml.example	2021-03-15 00:03:30.690118381 -0500
+++ docker-compose.yml	2021-03-15 00:08:55.851414757 -0500
@@ -1,27 +1,7 @@
-version: "3"
+DJANGO_SECRET_KEY=<my-secret-key>
+DJANGO_DEBUG=False
 
-services:
-  ihatetobudget:
-    build: .
-    command: pipenv run daphne -b 0.0.0.0 ihatetobudget.asgi:application
-    restart: always
-    volumes:
-      - .:/usr/src/app
-      - static:/static
-    env_file: docker-compose.env
-  caddy:
-    image: caddy:2.0.0
-    restart: always
-    ports:
-      - '80:80'
-    volumes:
-      - ./Caddyfile:/etc/caddy/Caddyfile
-      - caddy_data:/data
-      - static:/var/www/static
-    depends_on:
-      - ihatetobudget
-
-
-volumes:
-  caddy_data:
-  static:
+CURRENCY_GROUP_SEPARATOR=,
+CURRENCY_DECIMAL_SEPARATOR=.
+CURRENCY_PREFIX=$
+CURRENCY_SUFFIX=