ci: update dockerfile to include data folder

This commit is contained in:
Juan Rodriguez
2024-07-12 08:50:14 +02:00
parent 3050c2b100
commit cebbd48237
5 changed files with 2730 additions and 2706 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
id: extract_version
run: |
VERSION=$(grep -oP 'version:\s*\K\S+' shard.yml)
echo "RELEASE_TAG=$VERSION" >> $GITHUB_ENV
echo "RELEASE_TAG=${VERSION}" >> $GITHUB_ENV
- name: Build and push image
id: push
+2
View File
@@ -7,3 +7,5 @@
/sqlite/
.env.production
resource_usage.txt
+8 -1
View File
@@ -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
@@ -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"]
+9 -1
View File
@@ -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)
+2710 -2703
View File
File diff suppressed because it is too large Load Diff