v0.5 — docker entrypoint, data init
This commit is contained in:
+2
-2
@@ -5,9 +5,9 @@ COPY package*.json ./
|
|||||||
RUN npm ci --only=production
|
RUN npm ci --only=production
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN mkdir -p assets/deck-images
|
RUN mkdir -p assets/deck-images && chmod +x entrypoint.sh
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# If Docker created these paths as directories (because the host file didn't exist),
|
||||||
|
# remove them and create proper JSON files.
|
||||||
|
for f in /app/colony.json /app/decks.json; do
|
||||||
|
if [ -d "$f" ]; then
|
||||||
|
rm -rf "$f"
|
||||||
|
fi
|
||||||
|
if [ ! -f "$f" ]; then
|
||||||
|
echo '{}' > "$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir -p /app/assets/deck-images
|
||||||
|
|
||||||
|
exec node server.js
|
||||||
Reference in New Issue
Block a user