Skip to content

Commit e7e6c60

Browse files
committed
feat(container) alpine base
1 parent ab7b36a commit e7e6c60

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Dockerfile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM oven/bun:alpine
1+
FROM alpine:3.22.2
22
## Building the Application
33
# docker buildx build -t text0wnz:latest .
44
#
@@ -25,26 +25,34 @@ LABEL org.opencontainers.image.authors="xero <x@xero.style>"
2525
LABEL org.opencontainers.image.description="Text-mode art editor for ANSI, ASCII, XBIN, NFO, & TXT files"
2626
LABEL org.opencontainers.image.source="https://github.com/xero/text0wnz"
2727

28-
# Environment variables to override at runtime
2928
ENV DOMAIN="localhost"
3029
ENV PORT=1337
3130
ENV NODE_ENV="production"
32-
# Set Caddy's storage location via environment variable
3331
ENV XDG_DATA_HOME="/var/lib/caddy"
3432
ENV XDG_CONFIG_HOME="/etc/caddy"
3533

36-
# Create non-root user
34+
# Create unprivileged user
3735
RUN addgroup -S textart && \
3836
adduser -S -G textart -h /app textart
3937

4038
WORKDIR /app
4139
COPY . .
4240

4341
# Install dependencies
44-
RUN apk add --no-cache caddy=2.7.6-r7 gettext=0.22.5-r0 netcat-openbsd=1.226-r0
42+
RUN apk add --no-cache \
43+
libstdc++=14.2.0-r6 \
44+
libgcc=14.2.0-r6 \
45+
curl=8.14.1-r2 \
46+
ca-certificates \
47+
npm=11.3.0-r1 \
48+
caddy=2.10.0-r3 \
49+
gettext=0.24.1-r0 \
50+
netcat-openbsd=1.229.1-r0
51+
RUN npm i -g bun
4552
RUN bun i && bun bake
4653

4754
# Cleanup
55+
RUN apk del npm
4856
RUN rm -rf \
4957
.env \
5058
.git \
@@ -66,7 +74,7 @@ RUN rm -rf \
6674
tests \
6775
/var/cache/apk/*
6876

69-
# Create directory structure with proper permissions
77+
# Create directory structure w/ permissions for our user
7078
RUN mkdir -p /etc/caddy /var/log /var/lib/caddy /home/textart/.local/share && \
7179
chown -R textart:textart /app /var/log /var/lib/caddy /etc/caddy /home/textart && \
7280
chmod -R 755 /app

0 commit comments

Comments
 (0)