Skip to content

Commit 61eafe8

Browse files
authored
Merge pull request #21 from mapswipe/fix/yarn-install
2 parents 99b44f6 + 6c92c12 commit 61eafe8

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.github/workflows/docker-push-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
REPO_NAME: ghcr.io/${{ github.repository }}
2222
run: |
2323
REPO_NAME=$(echo $REPO_NAME | tr '[:upper:]' '[:lower:]')
24-
TAG="0.0.1-dev"
24+
TAG="0.2.0-dev"
2525
2626
# Docker
2727
echo "docker_image_name=${REPO_NAME}" >> $GITHUB_OUTPUT

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
FROM node:22-bullseye-slim
55

66
RUN apt-get update -y \
7-
&& apt-get install -y --no-install-recommends openjdk-11-jdk bash procps
7+
&& apt-get install -y --no-install-recommends \
8+
openjdk-11-jdk bash procps git
89

910
WORKDIR /firebase
1011

docker_entrypoint.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,23 @@
22

33
set -e
44

5-
# TODO: This may need another look
6-
cd functions
7-
yarn install --frozen-lockfile
5+
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
FIREBASE_FUNCTIONS_DIR="$BASE_DIR/functions/"
7+
8+
cd "$BASE_DIR"
9+
10+
# NOTE: when we are using mapswipe-firebase as a submodule inside docker,
11+
# the .git directory is not accessible. The parent .git directory is in host
12+
# system not accesssible by the container
13+
# Inside the container, yarn install fails when we are installing packages from git repository.
14+
# So, we need to switch to /tmp directory as a workaround
15+
echo "[INFO] Installing dependencies for transpiling functions for Firebase..."
16+
cd /tmp/
17+
yarn --cwd "$FIREBASE_FUNCTIONS_DIR" install --frozen-lockfile
18+
19+
echo "[INFO] Transpiling functions for Firebase..."
20+
cd "$FIREBASE_FUNCTIONS_DIR"
821
yarn build
9-
cd ../
1022

1123
# PIDs
1224
pid=0
@@ -31,6 +43,7 @@ graceful_shutdown() {
3143
}
3244

3345
# Trap SIGINT and SIGTERM for Docker shutdown
46+
3447
trap graceful_shutdown SIGINT SIGTERM
3548

3649
# Start Firebase emulator in background

0 commit comments

Comments
 (0)