-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM ocaml/opam:debian-12-ocaml-5.1 as build | ||
WORKDIR /build | ||
|
||
# Install dependencies. | ||
RUN sudo apt-get update | ||
RUN sudo apt-get install -y libev-dev libpq-dev pkg-config | ||
|
||
COPY . . | ||
|
||
RUN opam install --deps-only . | ||
|
||
# Build project. | ||
RUN opam exec -- dune build | ||
|
||
|
||
|
||
FROM debian:bookworm-slim as run | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y libev4 libpq5 libssl3 | ||
|
||
COPY --from=build /build/_build/default/bin/main.exe /bin/acmebank | ||
|
||
ENTRYPOINT /bin/acmebank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '3' | ||
services: | ||
postgres: | ||
image: postgres:16-alpine | ||
container_name: bankservice-postgres | ||
restart: always | ||
environment: | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
networks: | ||
- default | ||
|
||
bankservice-api: | ||
image: acmesky-bankservice-api | ||
container_name: bankservice-api | ||
environment: | ||
- DATABASE_URL=${DATABASE_URL} | ||
depends_on: | ||
- postgres | ||
ports: | ||
- "8080:8080" | ||
restart: unless-stopped | ||
|
||
volumes: | ||
postgres-data: |