Skip to content

Commit db4ac0d

Browse files
committed
feat: fix dockerfile implementation
1 parent a3aaeb9 commit db4ac0d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

silverback/_cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
FROM ghcr.io/apeworx/silverback:stable
3434
USER root
3535
WORKDIR /app
36-
RUN mkdir -p ./bots && chown harambe:harambe /app/bots
36+
RUN chown harambe:harambe /app
3737
USER harambe
3838
COPY ape-config.yaml .
3939
COPY requirements.txt .
@@ -144,12 +144,13 @@ def build(generate, path):
144144
break
145145
bots.append(file)
146146
for bot in bots:
147+
dockerfile_content = DOCKERFILE_CONTENT
147148
if "__init__" in bot.name:
148149
docker_filename = f"Dockerfile.{bot.parent.name}"
150+
dockerfile_content += f"COPY {path.name}/ /app/bot"
149151
else:
150152
docker_filename = f"Dockerfile.{bot.name.replace('.py', '')}"
151-
dockerfile_content = DOCKERFILE_CONTENT
152-
dockerfile_content += f"COPY {path.name}/{bot.name} bots/bot.py"
153+
dockerfile_content += f"COPY {path.name}/{bot.name} /app/bot.py"
153154
dockerfile_path = Path.cwd() / ".silverback-images" / docker_filename
154155
dockerfile_path.parent.mkdir(exist_ok=True)
155156
dockerfile_path.write_text(dockerfile_content.strip() + "\n")

0 commit comments

Comments
 (0)