ci: update dockerfile to include data folder
This commit is contained in:
@@ -35,7 +35,7 @@ jobs:
|
|||||||
id: extract_version
|
id: extract_version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(grep -oP 'version:\s*\K\S+' shard.yml)
|
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
|
- name: Build and push image
|
||||||
id: push
|
id: push
|
||||||
|
|||||||
@@ -7,3 +7,5 @@
|
|||||||
|
|
||||||
/sqlite/
|
/sqlite/
|
||||||
.env.production
|
.env.production
|
||||||
|
|
||||||
|
resource_usage.txt
|
||||||
|
|||||||
+8
-1
@@ -1,10 +1,16 @@
|
|||||||
FROM alpine:edge as base
|
FROM alpine:edge as base
|
||||||
WORKDIR /usr/src/app
|
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
|
FROM base AS build
|
||||||
ENV ENV=production
|
ENV ENV=production
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN shards install
|
RUN shards install
|
||||||
@@ -14,6 +20,7 @@ FROM base AS release
|
|||||||
RUN mkdir -p /usr/src/app/sqlite
|
RUN mkdir -p /usr/src/app/sqlite
|
||||||
COPY --from=build /usr/src/app/db db
|
COPY --from=build /usr/src/app/db db
|
||||||
COPY --from=build /usr/src/app/bin /usr/local/bin
|
COPY --from=build /usr/src/app/bin /usr/local/bin
|
||||||
|
COPY --from=build /usr/src/app/data /usr/local/data
|
||||||
|
|
||||||
EXPOSE 4000/tcp
|
EXPOSE 4000/tcp
|
||||||
CMD ["bit"]
|
CMD ["bit"]
|
||||||
|
|||||||
+9
-1
@@ -128,8 +128,16 @@ function measure {
|
|||||||
echo "Setup..."
|
echo "Setup..."
|
||||||
|
|
||||||
docker-compose up -d
|
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
|
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
|
# Create a new user and capture the API key
|
||||||
output=$(docker-compose exec -T app cli --create-user=Admin)
|
output=$(docker-compose exec -T app cli --create-user=Admin)
|
||||||
|
|||||||
+2710
-2703
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user