Skip to content

Commit

Permalink
update dockerfile and add justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitznik committed Jan 5, 2024
1 parent afea2b7 commit c53a53a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM rust as builder
FROM rust:1-bookworm as builder
WORKDIR /usr/src/app

COPY . .
RUN cargo build --release --bin robswebhub

#fontconfig libfontconfig1
FROM debian:bullseye-slim AS runtime
FROM debian:bookworm-slim AS runtime
WORKDIR /usr/src/app
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends openssl ca-certificates pkg-config fontconfig libfontconfig1 libfreetype6-dev libfontconfig1-dev \
Expand Down
13 changes: 13 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
setup-env:
./scripts/init_postgres.sh

teardown-env:
RUNNING_POSTGRES_CONTAINER=$(docker ps --filter 'name=postgres' --format '{{{{.ID}}') && docker kill ${RUNNING_POSTGRES_CONTAINER}

build:
docker build -t robswebhub .

run:
docker run -p 8080:8080 --env APP_ENVIRONMENT=production --env APP_APPLICATION__PORT=8080 --env DATABASE_URL="postgres://postgres:password@localhost:5432/robswebhub" robswebhub

build-and-run: build run

0 comments on commit c53a53a

Please sign in to comment.