Skip to content

Commit e26bd94

Browse files
committed
chore: wip
chore: wip chore: wip
1 parent 5c55843 commit e26bd94

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

storage/framework/.biomelintrc-auto-import.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,4 +345,4 @@
345345
"whenever"
346346
]
347347
}
348-
}
348+
}

storage/framework/server/Dockerfile

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
1-
# use the official Bun image
2-
# see all versions at https://hub.docker.com/r/oven/bun/tags
3-
FROM oven/bun:1.1.26-debian AS base
1+
# Build stage
2+
FROM oven/bun:1.1.27-debian AS builder
43
WORKDIR /usr/src
54

6-
# Install curl - I wonder if there is a better way to do this, because it is only needed for the healthcheck — is wget installed by default?
5+
# Install curl and build dependencies if needed
76
USER root
8-
RUN apt-get update && apt-get install -y curl
9-
USER bun
10-
11-
# RUN apt-get update && apt-get install -y curl
12-
13-
# [optional] tests & build
14-
# ENV NODE_ENV=production
15-
# RUN bun test
16-
# RUN bun run build
7+
RUN apt-get update && apt-get install -y --no-install-recommends curl && apt-get clean && rm -rf /var/lib/apt/lists/*
178

18-
# copy production dependencies and source code into final image
19-
FROM base AS release
9+
# Copy source files
2010
COPY ./app ./app
2111
COPY ./config ./config
2212
COPY ./docs ./docs
2313
COPY ./dist ./dist
2414
COPY ./tsconfig.docker.json ./tsconfig.json
2515

26-
# Combine COPY and chown for storage
27-
RUN mkdir -p ./storage && chown -R bun:bun ./storage
16+
# [optional] Run tests and build
17+
# ENV NODE_ENV=production
18+
# RUN bun test
19+
# RUN bun run build
20+
21+
# Final stage
22+
FROM oven/bun:1.1.27-debian AS release
23+
WORKDIR /usr/src
24+
25+
# Copy built files from builder stage
26+
COPY --from=builder /usr/src/app ./app
27+
COPY --from=builder /usr/src/config ./config
28+
COPY --from=builder /usr/src/docs ./docs
29+
COPY --from=builder /usr/src/dist ./dist
30+
COPY --from=builder /usr/src/tsconfig.json ./tsconfig.json
31+
32+
# Set up storage directory
33+
USER root
34+
RUN mkdir -p ./storage && chown -R bun:bun ./storage && apt-get update && apt-get install -y --no-install-recommends curl && apt-get clean && rm -rf /var/lib/apt/lists/*
35+
2836
COPY --chown=bun:bun ./storage ./storage
2937

3038
# Add storage volume for logs and other files
3139
VOLUME ["/usr/src/storage"]
3240

33-
# run the app
41+
# Switch to non-root user
3442
USER bun
43+
44+
# Expose port and set entrypoint
3545
EXPOSE 3000/tcp
36-
ENTRYPOINT [ "bun", "run", "dist/index.js" ]
46+
ENTRYPOINT ["bun", "run", "dist/index.js"]

0 commit comments

Comments
 (0)