feat: Updates to justfile.

This commit is contained in:
2025-03-02 14:24:43 -05:00
parent d6d400b6ec
commit a8022ec80a
2 changed files with 38 additions and 2 deletions

32
Dockerfile.dev Normal file
View File

@@ -0,0 +1,32 @@
FROM swift:6.0-noble
# Make sure all system packages are up to date, and install only essential packages.
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get -q install -y \
libjemalloc2 \
ca-certificates \
tzdata \
# If your app or its dependencies import FoundationNetworking, also install `libcurl4`.
libcurl4 \
# If your app or its dependencies import FoundationXML, also install `libxml2`.
# libxml2 \
sqlite3 \
&& rm -r /var/lib/apt/lists/*
# Set up a build area
WORKDIR /app
# First just resolve dependencies.
# This creates a cached layer that can be reused
# as long as your Package.swift/Package.resolved
# files do not change.
COPY ./Package.* ./
RUN swift package resolve \
$([ -f ./Package.resolved ] && echo "--force-resolved-versions" || true)
# Copy entire repo into container
COPY . .
CMD ["swift", "test"]

View File

@@ -1,8 +1,9 @@
docker_image := "hvac-toolbox"
docker_tag := "latest"
docker_registiry := "registry.digitalocean.com/swift-hvac-toolbox"
build-docker:
@docker build -t {{docker_image}}:{{docker_tag}} .
build-docker platform="linux/arm64":
@docker build --platform {{platform}} -t {{docker_registiry}}/{{docker_image}}:{{docker_tag}} .
run:
#!/usr/bin/env zsh
@@ -16,3 +17,6 @@ run-css:
clean:
@rm -rf .build
push-image:
@docker push {{docker_registiry}}/{{docker_image}}:{{docker_tag}}