diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a9229aaebaf92c111f0a53ee50b8365d2358b76f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:10-alpine + +WORKDIR /opt/app +ENV TZ Europe/Budapest +RUN apk add --no-cache tzdata && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Copying application files +COPY ./src ./src +COPY ./public ./public +COPY package.json yarn.lock package-lock.json ./ + +# Installing dependencies +RUN npm install + +# Building the application +RUN npm run build + +# Running +EXPOSE 3000 +ENTRYPOINT ["npm", "run", "start"] + diff --git a/README.md b/README.md index 2c2a1f06b5c7559580c128c9597ed79b2a060f49..ccd3e0ed3130f293ef9b30606ab11a1e3404e856 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,25 @@ ## Run & Install ```bash npm install -# or + +## or yarn install cp config.js.temp config.js npm start -# or +## or yarn start ``` + +# Docker +``` +sudo docker image build -t kszkepzes-frontend . +sudo docker container run --publish 3000:3000 --name kszkepzes-frontend kszkepzes-frontend +``` + +If you want to run in detached mode +``` +sudo docker container run --publish 3000:3000 --detach --name kszkepzes-frontend kszkepzes-frontend +``` +