-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (56 loc) · 2.65 KB
/
Dockerfile
File metadata and controls
68 lines (56 loc) · 2.65 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Dockerfile for Doula Cooperative CI builds
# Includes tools for Hugo, Angular, Firebase, and Playwright E2E testing
FROM ubuntu:22.04
# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive
# Set versions for our tools as arguments
ARG HUGO_VERSION=0.160.1
ARG DART_SASS_VERSION=1.99.0
ARG BUN_VERSION=1.3.12
ARG PLAYWRIGHT_VERSION=1.59.1
# 1. Install base dependencies and Java 21 (required for Firebase emulators - firebase-tools requires Java 21+)
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
wget \
ca-certificates \
unzip \
git \
openjdk-21-jre-headless \
&& rm -rf /var/lib/apt/lists/*
# Set JAVA_HOME for Firebase emulators
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
ENV PATH="${JAVA_HOME}/bin:${PATH}"
# Configure git to trust the workspace directory to avoid ownership errors in GitHub Actions
RUN git config --global --add safe.directory /__w/doula-cooperative/doula-cooperative && \
git config --system --add safe.directory /__w/doula-cooperative/doula-cooperative && \
git config --system --add core.quotepath false
# Install Node.js 24.x (required by Firebase Functions)
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& apt-get install -y nodejs
# 2. Install Bun
RUN curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}"
ENV PATH="/root/.bun/bin:$PATH"
# 3. Install Hugo (Extended Version)
RUN wget "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb" \
&& apt-get install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb
# 4. Install Dart Sass
RUN wget "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" \
&& tar -xzf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" \
&& mv dart-sass /usr/local/share/ \
&& ln -s /usr/local/share/dart-sass/sass /usr/local/bin/sass \
&& rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
# 5. Install Playwright with Chromium browser and dependencies
# Use a fixed path for browsers to avoid HOME directory issues in GitHub Actions
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers
RUN bunx playwright@${PLAYWRIGHT_VERSION} install chromium --with-deps
# 6. Verify installations
RUN echo "Bun version: $(bun --version)"
RUN echo "Hugo version: $(hugo version)"
RUN echo "Sass version: $(sass --version)"
RUN echo "Node.js version: $(node --version)"
RUN echo "Java version:" && java -version
RUN echo "JAVA_HOME: ${JAVA_HOME}"
RUN bunx playwright@${PLAYWRIGHT_VERSION} --version
# Set the working directory for when the container starts
WORKDIR /workspace