Skip to content

Commit

Permalink
bump dotnet and node version
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Oct 3, 2024
1 parent b0e863c commit 9bb9c44
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ async function buildBranch(branch, moduleType) {
{
const [buildHash, tags] = generateTags(branch, version, moduleType, modulesVersions);
console.log(chalk.gray('Building server with tags ' + tags.map(e => chalk.white(chalk.bold(e))).join(', ')));
await buildDocker(serverImageName, tags, branch, './server/Dockerfile', moduleType, buildHash);

const dockerFile = branch === 'release' ? './server/Dockerfile' : './server/DockerfileDotnet8'

await buildDocker(serverImageName, tags, branch, dockerFile, moduleType, buildHash);
console.log(chalk.green('Server on branch ') + chalk.white(chalk.bold(branch)) + chalk.green(' built successfully'));
}

Expand Down
65 changes: 65 additions & 0 deletions server/DockerfileDotnet8
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
ARG MODULES="all"

FROM mcr.microsoft.com/dotnet/sdk:8.0.402-bookworm-slim-amd64 as base-all

USER root

RUN apt-get update -y
RUN apt-get install -y libatomic1 libc-bin wget apt-transport-https ca-certificates gnupg
RUN mkdir -p /etc/apt/keyrings
RUN wget -qO- https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update -y
RUN apt-get install nodejs -y
RUN apt autoremove -y
RUN apt-get clean


RUN mkdir /altv
RUN echo '{"loadBytecodeModule":true,"loadCSharpModule":true}' > /altv/.altvpkgrc.json

FROM node:22.8.0-bookworm-slim as base-js

USER root

RUN apt-get update -y
RUN apt-get install -y curl libatomic1 libc-bin wget apt-transport-https ca-certificates gnupg
RUN apt autoremove -y
RUN apt-get clean

RUN mkdir /altv
RUN echo '{"loadBytecodeModule":true}' > /altv/.altvpkgrc.json

FROM base-${MODULES} as ready

USER root

RUN npm i -g altv-pkg@^2.10.0

ADD ./config /root/setup
RUN cd /root/setup && npm i
RUN cd /root/setup && rm voice-server.js package-lock.json

COPY ./server/entrypoint.sh /root/
RUN chmod +x /root/entrypoint.sh

FROM ready as downloaded

USER root
ARG BRANCH=release
ARG MODULES="all"
ENV ALTV_BRANCH=$BRANCH
ENV ALTV_MODULE_TYPE=$MODULES

WORKDIR /altv/

EXPOSE 7788/udp
EXPOSE 7788/tcp

ARG CACHEBUST=1

RUN cd /altv && npx altv-pkg ${BRANCH}
RUN chmod +x /altv/altv-server
RUN chmod +x /altv/altv-crash-handler

ENTRYPOINT [ "/root/entrypoint.sh" ]

0 comments on commit 9bb9c44

Please sign in to comment.