unified docker image
This commit is contained in:
parent
68ba68a871
commit
2f1fed662d
6
.github/workflows/docker-image.yml
vendored
6
.github/workflows/docker-image.yml
vendored
@ -7,6 +7,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- name: Build the Unified Docker image
|
||||||
|
run: docker build . --file Dockerfile --tag albertoxamin/bang:latest
|
||||||
- name: Build the Backend Docker image
|
- name: Build the Backend Docker image
|
||||||
run: cd backend;docker build . --file Dockerfile --tag albertoxamin/bang-backend:latest
|
run: cd backend;docker build . --file Dockerfile --tag albertoxamin/bang-backend:latest
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -14,5 +16,5 @@ jobs:
|
|||||||
run: cd frontend;docker build . --file Dockerfile --tag albertoxamin/bang-frontend:latest
|
run: cd frontend;docker build . --file Dockerfile --tag albertoxamin/bang-frontend:latest
|
||||||
- name: Log into registry
|
- name: Log into registry
|
||||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||||
- name: Push iamges
|
- name: Push images
|
||||||
run: docker push albertoxamin/bang-backend:latest; docker push albertoxamin/bang-frontend:latest
|
run: docker push albertoxamin/bang:latest; docker push albertoxamin/bang-backend:latest; docker push albertoxamin/bang-frontend:latest
|
||||||
|
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
FROM node:lts-alpine as builder
|
||||||
|
COPY ./frontend .
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
FROM python:3.7-slim-stretch
|
||||||
|
COPY --from=builder ./dist /dist/
|
||||||
|
COPY ./backend /dist/
|
||||||
|
WORKDIR /dist
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
EXPOSE 5001
|
||||||
|
ENTRYPOINT ["python", "/dist/__init__.py"]
|
@ -8,7 +8,9 @@ from players import Player
|
|||||||
|
|
||||||
sio = socketio.Server(cors_allowed_origins="*")
|
sio = socketio.Server(cors_allowed_origins="*")
|
||||||
app = socketio.WSGIApp(sio, static_files={
|
app = socketio.WSGIApp(sio, static_files={
|
||||||
'/': {'content_type': 'text/html', 'filename': 'index.html'}
|
'/': {'content_type': 'text/html', 'filename': 'index.html'},
|
||||||
|
'/css': './css',
|
||||||
|
'/js': './js',
|
||||||
})
|
})
|
||||||
|
|
||||||
games: List[Game] = []
|
games: List[Game] = []
|
||||||
|
@ -5,7 +5,7 @@ Vue.config.productionTip = false
|
|||||||
import VueSocketIO from 'vue-socket.io'
|
import VueSocketIO from 'vue-socket.io'
|
||||||
Vue.use(new VueSocketIO({
|
Vue.use(new VueSocketIO({
|
||||||
debug: Vue.config.devtools,
|
debug: Vue.config.devtools,
|
||||||
connection: Vue.config.devtools?'http://localhost:5001':'http://bang.xamin.it:5001',
|
connection: Vue.config.devtools ? 'http://localhost:5001' : window.location.origin,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
|
Loading…
Reference in New Issue
Block a user