Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,47 @@ COPY . .
# Copy the .env file
COPY .env .env

# Install dependencies for Taskwarrior and libuuid-dev
RUN apk add --no-cache cmake g++ make tar util-linux-dev rust cargo libuuid libstdc++
RUN apk update
RUN apk add util-linux
RUN apk add libgcc
RUN apk add libstdc++
RUN apk add libgc++
RUN apk add libuuid

# Copy Taskwarrior source code and build it
COPY task-3.0.2.tar.gz /tmp/task-3.0.2.tar.gz
RUN tar xzf /tmp/task-3.0.2.tar.gz && \
cd task-3.0.2 && \
# Install dependencies for Taskwarrior and libuuid
RUN apk add --no-cache \
cmake \
g++ \
make \
tar \
util-linux-dev \
rust \
cargo \
libuuid \
libstdc++ \
libgcc \
# Ensure all required packages are installed
&& apk update \
&& apk add --no-cache \
libuuid \
libstdc++ \
libgcc \
util-linux

# Download and build Taskwarrior
RUN wget https://github.com/GothenburgBitFactory/taskwarrior/releases/download/v3.0.2/task-3.0.2.tar.gz -O /tmp/task-3.0.2.tar.gz && \
tar xzf /tmp/task-3.0.2.tar.gz -C /tmp && \
cd /tmp/task-3.0.2 && \
cmake -DCMAKE_BUILD_TYPE=release . && \
make && \
make install

# Build the Go application
RUN go build -o main .

# Use a minimal image for running the backend (Can use others as well)
# Use a minimal image for running the backend
FROM alpine:latest
WORKDIR /root/

# Install runtime dependencies
RUN apk add --no-cache \
libuuid \
libstdc++ \
libgcc

# Copy the binary and .env file from the build stage
COPY --from=build /app/main .
COPY --from=build /app/.env .
Expand Down
24 changes: 23 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ services:
- "80:80"
networks:
- tasknetwork
depends_on:
- backend
env_file:
- ./frontend/.env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3

backend:
build:
Expand All @@ -18,14 +27,27 @@ services:
- tasknetwork
depends_on:
- syncserver
env_file:
- ./backend/.env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
- ./backend/data:/app/data

syncserver:
# THIS IMAGE SHOULD BE PULLED FROM THE OFFICIAL TASKCHAMPION-SYNC-SERVER REPOSITORY
image: taskchampion-sync-server:latest
ports:
- "8080:8080"
networks:
- tasknetwork
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3

networks:
tasknetwork:
Expand Down