GithubHelp home page GithubHelp logo

Dockerfile about openestate-tool-server HOT 2 OPEN

openestate avatar openestate commented on June 9, 2024
Dockerfile

from openestate-tool-server.

Comments (2)

linus-ha avatar linus-ha commented on June 9, 2024

Okay, I've begun to understand how to build the server.

So here's what I've come up with:

FROM ubuntu:latest

LABEL maintainer="https://openestate.org/"
LABEL version="1.0.0"
LABEL description="A HSQLDB server for multi user installations of OpenEstate-ImmoTool"

# copy source
COPY . /app/OpenEstate-Tool-Server

## -- BUILD
# install maven
RUN apt update && apt install wget maven -y && apt-get clean
WORKDIR /app/OpenEstate-Tool-Server/
# bad quiqufix for commons-daemon-1.1.0
RUN wget "https://archive.apache.org/dist/commons/daemon/binaries/windows/commons-daemon-1.1.0-bin-windows.zip" -P /app/OpenEstate-Tool-Server/temp/commons-daemon/
RUN bash ./mvn-release-quick.sh

# copy package into root instead of installing package because of systemd
RUN cp -rf ./package/debian-amd64/OpenEstate-ImmoServer/* /

# clenaing up
WORKDIR /app
RUN rm -rf /app/OpenEstate-Tool-Server/

# DB dir
VOLUME [ "/var/lib/OpenEstate-ImmoServer/data" ]
# DB port
EXPOSE 9001

CMD [ "bash", "/opt/OpenEstate-ImmoServer/bin/Start.sh" ]

I would create a PR if #5 is fixed. Before that I wouldn't want to publish this.
systemd can't or shouldn't be used because it would ruin the approach of containerization in general.

Compare:
master...linus-ha:master

from openestate-tool-server.

pinhead84 avatar pinhead84 commented on June 9, 2024

Thanks for your feedback. The Dockerfile looks nice so far. Some thoughts about it:

  1. Is it necessary to build the application within the Dockerfile? Why not just download and extract the latest version from https://github.com/OpenEstate/OpenEstate-Tool-Server/releases/download/v1.0.0/OpenEstate-ImmoServer-1.0.0.linux-x86-64.tar.gz into /opt?

    This would make the build process easier, faster and Maven does not need to be installed via APT.

    In this case you only need to make sure, that environment variables are properly set before executing Start.sh:

    # Path to the folder, where the server log files are stored.
    RUN mkdir -p "/var/log/OpenEstate-ImmoServer"
    ENV SERVER_LOG_DIR "/var/log/OpenEstate-ImmoServer"
    
    # Path to the folder, where the server data files are stored.
    RUN mkdir -p "/var/lib/OpenEstate-ImmoServer"
    ENV SERVER_VAR_DIR "/var/lib/OpenEstate-ImmoServer"
    
    CMD [ "bash", "/opt/OpenEstate-ImmoServer/bin/Start.sh" ]
    
  2. Wouldn't it be useful to set the log folder as volume, too? - Also it might be useful to use /var/lib/OpenEstate-ImmoServer instead of /var/lib/OpenEstate-ImmoServer/data folder to make backups available?

    VOLUME [ "/var/lib/OpenEstate-ImmoServer", "/var/log/OpenEstate-ImmoServer" ]
    
  3. Maybe it would be nice, if the application's etc folder would be available externally. Otherwise it won't be possible to configure more then one database and to enable SSL encryption.

  4. Is FROM ubuntu:latest really necessary? - The application doesn't really need a full featured Ubuntu. Something like FROM debian:buster-slim would consume less disk space and would build faster. No further dependencies should be required (if the package is downloaded instead of build via Maven).

I'm not an expert in Docker - just used it for some smaller projects from time to time. So please let me know, what you think about it.

from openestate-tool-server.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.