Skip to content

Commit

Permalink
ci: update dockerfile to include data folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdonado committed Jul 12, 2024
1 parent 3050c2b commit 88d81ec
Show file tree
Hide file tree
Showing 4 changed files with 2,729 additions and 2,705 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@

/sqlite/
.env.production

resource_usage.txt
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
FROM alpine:edge as base
WORKDIR /usr/src/app

RUN apk add crystal shards sqlite-dev openssl-dev
RUN apk update && apk add --no-cache \
crystal \
shards \
yaml-dev \
sqlite-dev \
openssl-dev

FROM base AS build
ENV ENV=production

COPY . .

RUN shards install
Expand All @@ -14,6 +20,7 @@ FROM base AS release
RUN mkdir -p /usr/src/app/sqlite
COPY --from=build /usr/src/app/db db
COPY --from=build /usr/src/app/bin /usr/local/bin
COPY --from=build /usr/src/app/data /usr/local/data

EXPOSE 4000/tcp
CMD ["bit"]
10 changes: 9 additions & 1 deletion benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,16 @@ function measure {
echo "Setup..."

docker-compose up -d
# Ensure migrations are done
if [ $? -ne 0 ]; then
echo "Failed to start Docker containers."
exit 1
fi

docker-compose exec -T app migrate
if [ $? -ne 0 ]; then
echo "Failed to run database migrations."
exit 1
fi

# Create a new user and capture the API key
output=$(docker-compose exec -T app cli --create-user=Admin)
Expand Down
Loading

0 comments on commit 88d81ec

Please sign in to comment.