8000 fixes to z-docker-opam example by mostafatouny · Pull Request #379 · aantron/dream · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fixes to z-docker-opam example #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions example/z-docker-opam/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
FROM ocaml/opam:alpine as build
# Build Stage
# # # # #

FROM ocaml/opam:alpine AS build

# Install system dependencies
RUN sudo apk add --update libev-dev openssl-dev
RUN sudo apk add --update libev-dev openssl-dev gmp-dev

WORKDIR /home/opam

# Install dependencies
ADD hello.opam hello.opam
COPY z-docker-opam.opam z-docker-opam.opam
RUN opam install . --deps-only

# Build project
ADD . .
COPY . .
RUN opam exec -- dune build


# Run Stage
# # # # #

FROM alpine:3.18.4 as run
FROM alpine:3.18.4 AS run

RUN apk add --update libev

COPY --from=build /home/opam/_build/default/app.exe /bin/app

ENTRYPOINT /bin/app
ENTRYPOINT [ "/bin/sh", "-c", "/bin/app" ]
21 changes: 12 additions & 9 deletions example/z-docker-opam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

<br>

This example runs a simple Web app inside a [Docker](https://www.docker.com/)
container. It is a variant of [**`z-docker-esy`**](../z-docker-esy#folders-and-files), but
with [opam](https://opam.ocaml.org/) as the package manager.
This example runs a simple Web app inside a [Docker](https://www.docker.com/) container using [opam](https://opam.ocaml.org/) as the package manager.

All the instructions are the same as in
[**`z-docker-esy`**](../z-docker-esy#folders-and-files). The difference is in the
[`Dockerfile`](https://github.com/aantron/dream/blob/master/example/z-docker-opam/Dockerfile),
which, in this example, derives an image from one of the [opam base
images](https://hub.docker.com/r/ocaml/opam), and installs dependencies using
opam. The initial build requires at least 2 GB of memory.
Build the image from `Dockerfile`
```
DOCKER_BUILDKIT=1 docker build . --tag "docker-opam-im"
```

create and run the container
```
docker run --name docker-opam -p 8080:8080 docker-opam-im:latest
```

see also [**`z-docker-esy`**](../z-docker-esy#folders-and-files) for using `esy` package manager and `Docker compose`.

<br>

Expand Down
8 changes: 0 additions & 8 deletions example/z-docker-opam/deploy.sh

This file was deleted.

10 changes: 0 additions & 10 deletions example/z-docker-opam/docker-compose.yml

This file was deleted.

Loading
0