-
-
Save bradbeam/bc814a863d6f0ea184368858453501b1 to your computer and use it in GitHub Desktop.
l1j in containers
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
version: '3.3' | |
services: | |
db: | |
image: mariadb:10.2 | |
restart: always | |
environment: | |
MYSQL_DATABASE: 'l1jdb' | |
# So you don't have to use root, but you can if you like | |
MYSQL_USER: 'l1j' | |
# You can use whatever password you like | |
MYSQL_PASSWORD: 'l1j' | |
# Password for root access | |
MYSQL_ROOT_PASSWORD: 'password' | |
ports: | |
# <Port exposed> : < MySQL Port running inside container> | |
- '3306:3306' | |
expose: | |
# Opens port 3306 on the container | |
- '3306' | |
# Where our data will be persisted | |
volumes: | |
- type: volume | |
source: my-db | |
target: /var/lib/mysql | |
- type: bind | |
source: ./db | |
target: /docker-entrypoint-initdb.d | |
server: | |
image: l1j-en:latest | |
restart: always | |
ports: | |
- 2000:2000 | |
expose: | |
- 2000 | |
volumes: | |
- type: bind | |
source: ./config | |
target: /l1j/config | |
# Names our volume | |
volumes: | |
my-db: {} |
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
# https://github.com/kmindi/openjdk-ant-docker/blob/master/Dockerfile | |
FROM openjdk:11-slim as builder | |
ENV ANT_VERSION=1.10.9 | |
ENV ANT_HOME=/opt/ant | |
# Install OpenJFX and wget | |
RUN apt-get update && apt-get install -y --no-install-recommends wget openjfx | |
# Download and extract apache ant to opt folder | |
RUN wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz \ | |
&& wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz.sha512 \ | |
&& echo "$(cat apache-ant-${ANT_VERSION}-bin.tar.gz.sha512) apache-ant-${ANT_VERSION}-bin.tar.gz" | sha512sum -c \ | |
&& tar -zvxf apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt/ \ | |
&& ln -s /opt/apache-ant-${ANT_VERSION} /opt/ant \ | |
&& rm -f apache-ant-${ANT_VERSION}-bin.tar.gz \ | |
&& rm -f apache-ant-${ANT_VERSION}-bin.tar.gz.sha512 | |
# add executables to path | |
RUN update-alternatives --install "/usr/bin/ant" "ant" "/opt/ant/bin/ant" 1 && \ | |
update-alternatives --set "ant" "/opt/ant/bin/ant" | |
RUN mkdir /l1j /l1j/emblem | |
COPY lib /l1j/lib | |
COPY build.xml /l1j | |
COPY src /l1j/src | |
WORKDIR /l1j | |
RUN ant | |
#### Runtime | |
FROM gcr.io/distroless/java:11 | |
EXPOSE 2000 | |
WORKDIR /l1j | |
COPY maps /l1j/maps | |
COPY data /l1j/data | |
COPY lib /l1j/lib | |
COPY config /l1j/config | |
COPY --from=builder /l1j/l1jen.jar /l1j/l1jen.jar | |
COPY --from=builder /l1j/emblem /l1j/emblem | |
ENV JDK_JAVA_OPTIONS="-Xms1024m -Xmx1024m -cp l1jen.jar:lib/*" | |
ENTRYPOINT [ "java" ] | |
CMD [ "l1j.server.Server" ] |
Is that during the first startup or later on? Ive seen it take minutes to get the db initialized, but once it's up it seems to be running fine.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get this error when running the master branch of https://github.com/l1j-en/classic with these files: