Initial Docker set up.
parent
e4b2f871aa
commit
e0651bd04c
|
@ -1,2 +0,0 @@
|
|||
.env
|
||||
sql-data/
|
|
@ -1,2 +0,0 @@
|
|||
FROM python:latest
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
services:
|
||||
front-end:
|
||||
container_name: front-end
|
||||
build: ./front-end/Dockerfile
|
||||
ports:
|
||||
- 2500:80
|
||||
back-end:
|
||||
container_name: back-end
|
||||
build: ./back-end/Dockerfile
|
||||
ports:
|
||||
- 2501:80
|
||||
db:
|
||||
container_name: fleet-db
|
||||
image: mysql:9.0.1
|
||||
environment:
|
||||
MYSQL_DATABASE: 'fleetmanagement'
|
||||
MYSQL_USER: {fleetmanagement-user}
|
||||
MYSQL_PASSWORD: {fleetmanagement-pass}
|
||||
MYSQL_ROOT_PASSWORD: {fleetmanagent-root}
|
||||
ports:
|
||||
- 3306:3306
|
||||
volumes:
|
||||
- ./sql-data:/var/lib/mysql
|
|
@ -0,0 +1,11 @@
|
|||
FROM python:3.9
|
||||
|
||||
WORKDIR /code
|
||||
|
||||
COPY ./requirements.txt /code/requirements.txt
|
||||
|
||||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
||||
|
||||
COPY ./app /code/app
|
||||
|
||||
CMD ["fastapi", "run", "app/main.py", "--proxy-headers", "--port", "80"]
|
|
@ -0,0 +1,7 @@
|
|||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"message": "Hello World!"}
|
|
@ -0,0 +1,18 @@
|
|||
FROM node:latest AS builder
|
||||
|
||||
ENV NODE_ENV production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json .
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM httpd:latest as production
|
||||
ENV NODE_ENV production
|
||||
|
||||
COPY --from=builder /app/build/ /usr/local/apache2/htdocs/
|
Loading…
Reference in New Issue