-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from gflohr/16-create-dockerfile
16 create dockerfile
- Loading branch information
Showing
5 changed files
with
114 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Dockerfile | ||
.dockerignore | ||
.editorconfig | ||
.gitignore | ||
.gitmodules | ||
.husky | ||
.nvmrc | ||
.prettierrc | ||
.vscode | ||
contrib | ||
coverage | ||
dist | ||
documentation | ||
log | ||
node_modules | ||
peppol-bis-invoice-3 | ||
scripts | ||
test | ||
Makefile | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Stage 1: Build stage | ||
FROM alpine:latest AS builder | ||
|
||
ENV NODE_ENV=production | ||
ENV LIBREOFFICE=libreoffice | ||
|
||
RUN apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
npm \ | ||
libc6-compat | ||
|
||
RUN curl -fsSL https://bun.sh/install | bash && \ | ||
ln -s /root/.bun/bin/bun /usr/local/bin/bun | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
# Avoid "/bin/bash: line 1: husky: command not found"! | ||
RUN bun install husky | ||
RUN bun install --production | ||
|
||
# Stage 2: Runtime stage | ||
FROM alpine:latest | ||
|
||
ENV NODE_ENV=production | ||
ENV LIBREOFFICE=libreoffice | ||
|
||
RUN apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
libreoffice \ | ||
ttf-freefont \ | ||
font-noto \ | ||
font-noto-cjk \ | ||
font-noto-emoji | ||
|
||
WORKDIR /app | ||
COPY --from=builder /app /app | ||
|
||
# Copy the bun binary from the build stage to runtime | ||
COPY --from=builder /root/.bun /root/.bun | ||
RUN ln -s /root/.bun/bin/bun /usr/local/bin/bun | ||
|
||
RUN echo "export LIBREOFFICE=\${LIBREOFFICE:-libreoffice}" >> /etc/profile.d/libreoffice.sh | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["bun", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters