fix: 💥 fix breaking changes

Fixed some bugs and added nix development flake

#588 #596 This release also has breaking changes that will need you to replace your docker-compose.yml and .env with the ones included in this release
This commit is contained in:
Axel Olausson Holtenäs 2023-01-21 19:01:37 +01:00 committed by Vermium Sifell
parent 72ac9d3895
commit 89404de116
4 changed files with 35 additions and 11 deletions

View file

@ -1,12 +1,27 @@
# Do not use "around your text" ("")
# Timezone
TZ=Europe/Stockholm
# Do not touch unless you know what you doing
PUID=1000
PGID=1000
# Discord
DISCORD_TOKEN=
DISCORD_CLIENT_ID=
DISCORD_GUILD_ID=
# Database
DATABASE_URL=mysql://username:password@mariadb:3306/database
MYSQL_ROOT_PASSWORD=root
MYSQL_HOST=localhost
MYSQL_USER=username
MYSQL_PASSWORD=password
MYSQL_DATABASE=database
# DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING
DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${MYSQL_HOST}/${MYSQL_DATABASE}
# Encryption
ENCRYPTION_ALGORITHM=aes-256-ctr

View file

@ -21,9 +21,16 @@ WORKDIR /app
ENV NODE_ENV production
# Add mysql precheck
RUN apk add --no-cache mysql-client
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Copy files
COPY --from=build /app/package.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/prisma ./prisma
COPY --from=build /app/dist ./dist
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD [ "npm", "run", "start:migrate:prod" ]

View file

@ -27,13 +27,5 @@ services:
container_name: mariadb
image: lscr.io/linuxserver/mariadb:latest
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- TZ=Region/City
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=database
- MYSQL_USER=username
- MYSQL_PASSWORD=password
volumes:
- ./db:/config

10
docker-entrypoint.sh Normal file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env sh
echo "Check DB!"
while ! mysqladmin ping -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD}; do
echo "Wait ..."
sleep 1
done
echo "DB ready!"
${@}