Skip to content

Commit

Permalink
Merge pull request #14 from Silex/main
Browse files Browse the repository at this point in the history
- Fix docker permissions
- Fix docker name filtering to match specific container
  • Loading branch information
reyzzz authored Jan 2, 2025
2 parents 78029ca + 307d894 commit 7f3b101
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
FROM oven/bun:latest AS base

WORKDIR /usr/src/app

FROM base AS prerelease

ENV NODE_ENV=production
COPY package.json bun.lockb .
RUN bun install --frozen-lockfile --production
COPY . .
ENV NODE_ENV=production
RUN bun test
RUN bun run build

FROM base AS release
COPY --from=prerelease /usr/src/app/dist/index.js .

USER bun
ENV NODE_ENV=production
COPY --from=prerelease /usr/src/app/dist/index.js .
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "index.js" ]
2 changes: 1 addition & 1 deletion src/engine/DockerEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class DockerEngine implements IEngine {
private async getContainerId(container_name: string) {
if (this.container_id) return this.container_id
const data = await this.docker<ContainerInfo[]>(
`/containers/json?filters={"name":["${container_name}"]}`
`/containers/json?filters={"name":["^${container_name}$"]}`
)
if (data.length) this.container_id = data[0].Id
return this.container_id
Expand Down

0 comments on commit 7f3b101

Please sign in to comment.