forked from opentibiabr/canary
-
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.
improve: clean and update docker (opentibiabr#716)
Docker was not working very well, so I made a cleanup and update the Dockerfile and also the startup script to work with the current code. Also made some improvements to the script that docker uses to start canary.
- Loading branch information
Showing
13 changed files
with
275 additions
and
451 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
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
# Stage 1: Download all dependencies | ||
FROM ubuntu:22.04 AS dependencies | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends cmake git \ | ||
unzip build-essential ca-certificates curl zip unzip tar \ | ||
pkg-config ninja-build autoconf automake libtool libluajit-5.1-dev libluajit-5.1-common \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /opt | ||
RUN git clone https://github.com/microsoft/vcpkg --depth=1 \ | ||
&& ./vcpkg/bootstrap-vcpkg.sh | ||
|
||
WORKDIR /opt/vcpkg | ||
COPY vcpkg.json /opt/vcpkg/ | ||
RUN VCPKG_FORCE_SYSTEM_BINARIES=1 /opt/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install | ||
|
||
# Stage 2: create build | ||
FROM dependencies AS build | ||
|
||
COPY . /srv/ | ||
WORKDIR /srv | ||
|
||
RUN export VCPKG_ROOT=/opt/vcpkg/ && VCPKG_FORCE_SYSTEM_BINARIES=1 cmake --preset linux-release && cmake --build --preset linux-release | ||
|
||
# Stage 3: load data and execute | ||
FROM ubuntu:22.04 | ||
|
||
VOLUME [ "/data" ] | ||
|
||
COPY --from=build /srv/build/linux-release/bin/canary /bin/canary | ||
COPY LICENSE *.sql key.pem /canary/ | ||
COPY data /canary/data | ||
COPY data-canary /canary/data-canary | ||
COPY data-otservbr-global /canary/data-otservbr-global | ||
COPY config.lua.dist /canary/config.lua | ||
|
||
WORKDIR /canary | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
mariadb-client libluajit-5.1-dev libluajit-5.1-common wget curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY docker/data/01-test_account.sql 01-test_account.sql | ||
COPY docker/data/02-test_account_players.sql 02-test_account_players.sql | ||
COPY docker/data/start.sh start.sh | ||
|
||
ENTRYPOINT ["/canary/start.sh"] |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.