-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup docker compose for anyone to build and release locally
- Loading branch information
Bingnan Liu
committed
Dec 30, 2024
1 parent
3494e48
commit 875b5e3
Showing
4 changed files
with
68 additions
and
0 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,38 @@ | ||
# Use Ubuntu as base image | ||
FROM ubuntu:latest | ||
|
||
# Avoid prompts from apt | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install necessary dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
gpg \ | ||
xz-utils \ | ||
gcc \ | ||
make \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install DMD compiler | ||
RUN curl -fsS https://dlang.org/install.sh | bash -s dmd \ | ||
&& ln -s /root/dlang/dmd-*/linux/bin64/dmd /usr/local/bin/dmd \ | ||
&& ln -s /root/dlang/dmd-*/linux/bin64/dub /usr/local/bin/dub | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy only dependency files first to leverage Docker cache | ||
COPY dub.sdl ./ | ||
COPY lit/markdown/dub.json ./lit/markdown/ | ||
|
||
# Install dependencies | ||
RUN dub fetch --cache=local | ||
|
||
# Copy the rest of the project | ||
COPY . . | ||
|
||
# Build the project | ||
RUN make | ||
|
||
# Set the entrypoint to the binary | ||
ENTRYPOINT ["/app/bin/lit"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
services: | ||
app-release: | ||
build: . | ||
image: literate:latest | ||
|
||
volumes: | ||
build-bin-output: |