Skip to content
Snippets Groups Projects
Commit f674f182 authored by Eugen Ciur's avatar Eugen Ciur
Browse files

dockerfile/docker image

parent 9b7a6049
Branches
Tags
No related merge requests found
import ENV from 'papermerge/config/environment';
import Base from 'ember-simple-auth/authenticators/base'; import Base from 'ember-simple-auth/authenticators/base';
...@@ -26,7 +27,7 @@ export default class AuthToken extends Base { ...@@ -26,7 +27,7 @@ export default class AuthToken extends Base {
async authenticate(username, password) { async authenticate(username, password) {
let response, error; let response, error;
response = await fetch('http://localhost:8000/api/auth-token/', { response = await fetch(`${this.base_url}/auth-token/`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
...@@ -41,4 +42,8 @@ export default class AuthToken extends Base { ...@@ -41,4 +42,8 @@ export default class AuthToken extends Base {
throw new Error(error.non_field_errors[0]); throw new Error(error.non_field_errors[0]);
} }
} }
get base_url() {
return `${ENV.APP.HOST}/${ENV.APP.NAMESPACE}/`;
}
} }
...@@ -18,7 +18,7 @@ module.exports = function (environment) { ...@@ -18,7 +18,7 @@ module.exports = function (environment) {
}, },
APP: { APP: {
NAMESPACE: 'api', NAMESPACE: '',
WS_NAMESPACE: 'ws' // websockets namespace WS_NAMESPACE: 'ws' // websockets namespace
// Here you can pass flags/options to your application instance // Here you can pass flags/options to your application instance
// when it is created // when it is created
......
FROM node:14 as build
LABEL author="Eugen Ciur <eugen@papermerge.com>"
WORKDIR /src
ENV PATH /src/node_modules/.bin:$PATH
COPY app ./app
COPY config ./config
COPY public ./public
COPY .ember-cli ./
COPY ember-cli-build.js ./
COPY package.json ./
RUN npm install
RUN ember build --environment production
FROM nginx:1.21.1-alpine
COPY --from=build /src/dist/ /usr/share/nginx/html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment