aboutsummaryrefslogtreecommitdiff
path: root/Containerfile
blob: 263a8a1e1a8faa39013f7681d780e915e7a9ed38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM rust:latest

RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN chmod a+r /etc/apt/keyrings/docker.gpg
RUN echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update && apt-get install cmake npm docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

WORKDIR /pw

COPY . .

RUN cargo install wasm-pack

RUN wasm-pack build web/planetwars-rs --target web

RUN cargo build --release && rm target/release/build target/release/deps -rf

WORKDIR /pw/web/pw-server

RUN npm install --force && npm run build

RUN sed "s/module.exports=y;//" /pw/web/pw-server/.svelte-kit/output/client/_app/chunks/PlayerLog-*.js -i

WORKDIR /pw

ENTRYPOINT ["/pw/start.sh"]