1
Fork 0
mirror of https://github.com/Steffo99/todocolors.git synced 2024-10-16 07:17:28 +00:00

Add docker thingies

This commit is contained in:
Steffo 2023-08-04 19:28:46 +02:00
parent a312a8cead
commit 8795c2f9dd
Signed by: steffo
GPG key ID: 2A24051445686895
7 changed files with 155 additions and 0 deletions

View file

@ -3,6 +3,7 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/todoblue/todoblue.iml" filepath="$PROJECT_DIR$/todoblue/todoblue.iml" />
<module fileurl="file://$PROJECT_DIR$/todopod/todopod.iml" filepath="$PROJECT_DIR$/todopod/todopod.iml" />
<module fileurl="file://$PROJECT_DIR$/todored/todored.iml" filepath="$PROJECT_DIR$/todored/todored.iml" />
</modules>
</component>

10
todoblue/.dockerignore Normal file
View file

@ -0,0 +1,10 @@
/.devcontainer/
/.github/
/.git/
/.idea/
/.vscode/
/.next/
/node_modules/
/.dockerignore
/.gitignore
/todoblue.iml

18
todoblue/Dockerfile Normal file
View file

@ -0,0 +1,18 @@
FROM node:20
WORKDIR /usr/src/todoblue
COPY ./ ./
RUN yarn install
RUN yarn run build
ENTRYPOINT ["yarn", "run", "start"]
CMD ["--port=8081"]
LABEL org.opencontainers.image.title="Todocolors Blue"
LABEL org.opencontainers.image.description="Blue(lib) frontend for Todocolors"
LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
LABEL org.opencontainers.image.url="https://github.com/Steffo99/todocolors"
LABEL org.opencontainers.image.authors="Stefano Pigozzi <me@steffo.eu>"
EXPOSE 8081

View file

@ -0,0 +1,18 @@
services:
redis:
image: "redis"
restart: unless-stopped
red:
image: "ghcr.io/steffo99/todocolors-red"
restart: unless-stopped
environment:
REDIS_CONN: "redis://redis:6379/" # You probably don't need to change this
ports:
- "127.0.0.1:8080:8080"
blue:
image: "ghcr.io/steffo99/todocolors-blue"
restart: unless-stopped
environment:
NEXT_PUBLIC_API_BASE_URL: "ws://example.org:8080" # Change this to the URL where red will be accessible at
ports:
- "127.0.0.1:8081:8081"

9
todopod/todopod.iml Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

18
todored/.dockerignore Normal file
View file

@ -0,0 +1,18 @@
/.devcontainer/
/.github/
/.git/
/.idea/
/.vscode/
/benches/
/examples/
/media/
/target/
/tests/
/.dockerignore
/.gitignore
/Dockerfile
/icon.png
/LICENSE
/README.md
/rustfmt.toml
**/*.rs.bk

81
todored/Dockerfile Normal file
View file

@ -0,0 +1,81 @@
FROM --platform=${BUILDPLATFORM} rust:1.71-bullseye AS builder
ARG BUILDPLATFORM
ARG TARGETPLATFORM
RUN apt-get update && \
apt-get upgrade --assume-yes
RUN \
mkdir .cargo && \
echo '[net]' >> .cargo/config.toml && \
echo 'git-fetch-with-cli = true' >> .cargo/config.toml && \
echo >> .cargo/config.toml && \
if [ "${BUILDPLATFORM}" != "${TARGETPLATFORM}" ]; then \
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
apt-get install --assume-yes gcc-x86-64-linux-gnu; \
echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml; \
echo 'linker = "x86-64-linux-gnu-gcc"' >> .cargo/config.toml; \
echo >> .cargo/config.toml; \
fi && \
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
apt-get install --assume-yes gcc-aarch64-linux-gnu; \
echo '[target.aarch64-unknown-linux-gnu]' >> .cargo/config.toml; \
echo 'linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml; \
echo >> .cargo/config.toml; \
fi && \
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
apt-get install --assume-yes gcc-arm-linux-gnueabihf; \
echo '[target.armv7-unknown-linux-gnueabihf]' >> .cargo/config.toml; \
echo 'linker = "arm-linux-gnueabihf-gcc"' >> .cargo/config.toml; \
echo >> .cargo/config.toml; \
fi \
fi
RUN \
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
RUSTTARGET=x86_64-unknown-linux-gnu; \
fi && \
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
RUSTTARGET=aarch64-unknown-linux-gnu; \
fi && \
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
RUSTTARGET=armv7-unknown-linux-gnueabihf; \
fi && \
rustup target add ${RUSTTARGET}
WORKDIR /usr/src/todored/
COPY ./ ./
RUN \
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
RUSTTARGET=x86_64-unknown-linux-gnu; \
fi && \
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
RUSTTARGET=aarch64-unknown-linux-gnu; \
fi && \
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
RUSTTARGET=armv7-unknown-linux-gnueabihf; \
fi && \
cargo build --all-features --bins --release --target=${RUSTTARGET}
#############################################################################
FROM --platform=${TARGETPLATFORM} rust:1.71-slim-bullseye AS final
WORKDIR /usr/src/todored/
COPY --from=builder \
/usr/src/todored/target/*/release/todored \
/usr/bin/
ENTRYPOINT []
CMD []
LABEL org.opencontainers.image.title="Todocolors Red"
LABEL org.opencontainers.image.description="Red(is) backend for Todocolors"
LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
LABEL org.opencontainers.image.url="https://github.com/Steffo99/todocolors"
LABEL org.opencontainers.image.authors="Stefano Pigozzi <me@steffo.eu>"
ENV RUST_LOG "warn,todored=info"
ENV AXUM_HOST "0.0.0.0:8080"
EXPOSE 8080