-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.codapi
More file actions
40 lines (33 loc) · 1.51 KB
/
Dockerfile.codapi
File metadata and controls
40 lines (33 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM ubuntu:22.04
# Install dependencies including Docker CLI
RUN apt-get update && \
apt-get install -y curl ca-certificates gnupg lsb-release && \
# Add Docker's official GPG key
install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
chmod a+r /etc/apt/keyrings/docker.asc && \
# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
# Install Docker CLI only (not the daemon)
apt-get update && \
apt-get install -y docker-ce-cli && \
rm -rf /var/lib/apt/lists/*
# Download and install Codapi
ARG CODAPI_VERSION=0.13.0
WORKDIR /app
RUN curl -L -o codapi.tar.gz "https://github.com/nalgeon/codapi/releases/download/v${CODAPI_VERSION}/codapi_${CODAPI_VERSION}_linux_amd64.tar.gz" && \
tar xvzf codapi.tar.gz -C /app && \
mv /app/codapi /usr/local/bin/codapi && \
chmod +x /usr/local/bin/codapi && \
rm codapi.tar.gz
# Copy custom configuration
COPY codapi.json /app/codapi.json
# Override with custom Cosmos DB sandbox
COPY sandboxes/cosmosdb /app/sandboxes/cosmosdb
# Create temp directory for code snippets
RUN mkdir -p /tmp/codapi && chmod 777 /tmp/codapi
# Expose Codapi port
EXPOSE 1313
# Run Codapi server with custom config
CMD ["codapi", "serve", "--config", "/app/codapi.json"]