Add Dockerfile

This commit is contained in:
Wietse Wind
2023-10-07 01:40:19 +02:00
parent f92afc331c
commit a295844656
5 changed files with 32 additions and 0 deletions

4
.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
node_modules
.git
store
scripts

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
.DS_Store
/node_modules
/store
/scripts/docker-push.sh

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM node:20-alpine
WORKDIR /usr/src/app
VOLUME /usr/src/app/store
COPY package*.json ./
RUN apk add --no-cache --virtual .gyp \
py3-pip \
build-base \
make \
g++ \
&& mkdir store && chmod 777 store && npm install \
&& apk del .gyp
COPY . .
EXPOSE 3000
CMD [ "node", "." ]

3
scripts/docker-build.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
docker build . $1 -t xpop:latest

3
scripts/docker-run.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
source .env && docker run -i --name xpop --rm -p 3000:3000 xpop