Skip to content
Snippets Groups Projects
Commit f5c67607 authored by Lennart Kramer's avatar Lennart Kramer
Browse files

use multi-stage docker file for webserver build

parent 3663eef9
No related branches found
No related tags found
No related merge requests found
FROM golang:1-bookworm AS web
COPY ./buildweb.sh /
COPY ./src/web /src/web
WORKDIR /
RUN ./buildweb.sh
FROM debian:12
# e.g. 5.41.0
......@@ -44,8 +50,7 @@ RUN grep stackmaximaversion ${LIB}/stackmaxima.mac | grep -oP "\d+" >> /opt/maxi
RUN useradd -M "goemaxima-nobody"
# Add go webserver
COPY ./bin/web ${BIN}/goweb
COPY --from=web /bin/web ${BIN}/goweb
ENV GOEMAXIMA_LIB_PATH=/opt/maxima/assets/maximalocal.mac
ENV GOEMAXIMA_NUSER=$MAX_USER
......
......@@ -7,28 +7,6 @@ This implementation in golang strives to have faster startup and processing time
For some more information on how this works, [see the documentation](/doc/How_it_works.md).
Building a Docker Image
=======================
There are prebuilt images are already available on the [dockerhub](https://hub.docker.com/r/mathinstitut/goemaxima).
This section just describes the build process in case you want to build your own image anyway.
Normally, you can just skip this step and go to [Using the Docker Image](#using-the-docker-image) directly.
A docker image can be built by first building the web server with buildweb.sh, which will place the web server executable into `./bin/`.
In order for that to work, `go` needs to be installed.
After that, the docker container for a particular stackmaxima version can be built by invoking `buildimage.sh STACKMAXIMA_VERSION` with `STACKMAXIMA_VERSION` substitutet to be the stackmaxima version to base the container off.
Example:
```
$ ./buildweb.sh
$ ./buildimage.sh 2020061000
```
The image should then be available as `goemaxima:2020061000-dev`.
The supported stackmaxima versions can be seen by looking at the versions file of the root of this repository.
Using the Docker Image
======================
......@@ -94,6 +72,25 @@ What Stackmaxima version do I need?
| - | `4.7.0` | 2024072400 | 5.44.0 |
Building a Docker Image
=======================
There are prebuilt images are already available on the [dockerhub](https://hub.docker.com/r/mathinstitut/goemaxima).
This section just describes the build process in case you want to build your own image anyway.
Normally, you can just skip this step and go to [Using the Docker Image](#using-the-docker-image) directly.
The docker container for a particular stackmaxima version can be built by invoking `buildimage.sh STACKMAXIMA_VERSION` with `STACKMAXIMA_VERSION` being the stackmaxima version to base the container off.
Example:
```
$ ./buildimage.sh 2020061000
```
The image should then be available as `goemaxima:2020061000-dev`.
The supported stackmaxima versions can be seen by looking at the versions file of the root of this repository.
Environment Variables
=====================
A few internal options can be set from environment variables.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment