Update
This commit is contained in:
parent
d3a6986eb8
commit
38e9027d09
@ -11,9 +11,9 @@ COPY ./dist /app/dist
|
|||||||
|
|
||||||
COPY ./server /app/server
|
COPY ./server /app/server
|
||||||
|
|
||||||
copy ./db /app/db
|
copy ./menu.db /app/db/
|
||||||
|
|
||||||
RUN pnpm install
|
RUN npm install
|
||||||
|
|
||||||
# RUN ls -lh .
|
# RUN ls -lh .
|
||||||
|
|
||||||
|
33
Makefile
Normal file
33
Makefile
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
PROJECT = menuserver
|
||||||
|
|
||||||
|
VERSION = latest
|
||||||
|
|
||||||
|
|
||||||
|
ECR_REPO = git.caliban.io/martin
|
||||||
|
# APP_IMAGE = 482681734622.dkr.ecr.eu-west-1.amazonaws.com/$(PROJECT):$(VERSION)
|
||||||
|
APP_IMAGE = $(ECR_REPO)/$(PROJECT):$(VERSION)
|
||||||
|
# APP_IMAGE = $(PROJECT):$(VERSION)
|
||||||
|
NO_CACHE = true
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build:
|
||||||
|
|
||||||
|
# docker build ./docker/. -t $(APP_IMAGE) --build-arg VERSION=$(VERSION) --no-cache=$(NO_CACHE) --compress=true
|
||||||
|
docker build --platform linux/amd64 --no-cache -force-rm --tag ${APP_IMAGE} --file ./Docker/Dockerfile .
|
||||||
|
|
||||||
|
|
||||||
|
#push docker image to registry
|
||||||
|
.PHONY: push
|
||||||
|
push: build
|
||||||
|
docker push $(APP_IMAGE)
|
||||||
|
|
||||||
|
|
||||||
|
#push docker image to registry
|
||||||
|
.PHONY: run
|
||||||
|
run: build
|
||||||
|
docker run $(APP_IMAGE)
|
||||||
|
|
||||||
|
ver:
|
||||||
|
@echo '$(VERSION)'
|
||||||
|
#echo $ERSION
|
||||||
|
.PHONY: ver
|
@ -23,7 +23,7 @@ app.use(session({
|
|||||||
'saveUninitialized': true
|
'saveUninitialized': true
|
||||||
}));
|
}));
|
||||||
app.get('/', (request, response) => {
|
app.get('/', (request, response) => {
|
||||||
if (request.session.auth)
|
/* if (request.session.auth)
|
||||||
response.redirect('/menu');
|
response.redirect('/menu');
|
||||||
else
|
else
|
||||||
if (!localHost)
|
if (!localHost)
|
||||||
@ -33,7 +33,11 @@ app.get('/', (request, response) => {
|
|||||||
request.session.username = 'martin';
|
request.session.username = 'martin';
|
||||||
request.session.auth = 'jhgkjgkjhgkjhgjkhgjkhgfhghfjgfjhgf';
|
request.session.auth = 'jhgkjgkjhgkjhgjkhgjkhgfhghfjgfjhgf';
|
||||||
response.redirect('/menu');
|
response.redirect('/menu');
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
request.session.username = 'martin';
|
||||||
|
request.session.auth = 'jhgkjgkjhgkjhgjkhgjkhgfhghfjgfjhgf';
|
||||||
|
response.redirect('/menu');
|
||||||
});
|
});
|
||||||
app.get('/menu', checkAuth, (req, res) => {
|
app.get('/menu', checkAuth, (req, res) => {
|
||||||
res.sendFile(path.join(`${__dirname}/dist/index.html`));
|
res.sendFile(path.join(`${__dirname}/dist/index.html`));
|
||||||
|
Loading…
Reference in New Issue
Block a user