Skip to content

Commit dff6c9b

Browse files
author
Dawid Iwański
authored
Update scratch to include zoneinfo
1 parent 7ef9b9f commit dff6c9b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,25 @@ COPY ./templates ./templates
2323
RUN npm install && \
2424
npx tailwindcss -i ./static/css/input.css -o ./static/css/style.css --minify
2525

26-
# Start from a complete image
27-
FROM alpine:latest as certs
28-
RUN apk --update add ca-certificates
26+
# Certificates and timezone data stage
27+
FROM alpine:3.19 as certs
28+
RUN apk update && apk add --no-cache ca-certificates tzdata
2929

30-
# Final stage
30+
# Start from a complete image and include timezone data
3131
FROM scratch
3232
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
33+
# Include timezone data
34+
COPY --from=certs /usr/share/zoneinfo /usr/share/zoneinfo
3335

3436
WORKDIR /app
3537
COPY --from=builder /app/blogo /app/blogo
3638
COPY --from=builder /app/articles /app/articles
37-
38-
# Copy HTML files
3939
COPY templates templates
4040
COPY static static
41-
4241
COPY --from=node /app/static/css/style.css ./static/css/style.css
42+
43+
# Ensure the app uses the right timezone by setting the TZ environment variable
44+
ENV TZ="Europe/Warsaw"
4345
ENV PATH="/app:$PATH"
4446

4547
EXPOSE 3000

0 commit comments

Comments
 (0)