Skip to content

Commit

Permalink
Updated docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
soaibsafi committed Jun 25, 2024
1 parent f30b4a9 commit 469415b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 97 deletions.
5 changes: 1 addition & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ FLASK_ENV=development
GOOGLE_CLIENT_ID=google-client-id
GOOGLE_CLIENT_SECRET=google-client-secret
GITHUB_CLIENT_ID=github-client-id
GITHUB_CLIENT_SECRET=github-client-secret
MONGO_URL=mongodb://mongo:27017/meteor
METEOR_SETTINGS={"env": {"API_URL": "http://api:8080","FMP_URL": "http://fmp-backend:8000", "MAX_INSTANCES": 20}}
STARTUP_DELAY=10
GITHUB_CLIENT_SECRET=github-client-secret
50 changes: 8 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<h1>FM Playground</h1>
<a href="https://play.formal-methods.net/"><img src="https://img.shields.io/website?url=https%3A%2F%2Fplay.formal-methods.net%2F&label=play.formal-methods.net" alt="FM Playground"></a>
<img alt="GitHub Repository size" src="https://img.shields.io/github/repo-size/se-buw/fm-playground">
<img alt="Total Lines" src="https://tokei.rs/b1/github/se-buw/fm-playground">
<img src="https://img.shields.io/github/issues/se-buw/fm-playground" alt="GitHub issues">
<img src="https://img.shields.io/github/license/se-buw/fm-playground" alt="GitHub License">
<hr>
Expand Down Expand Up @@ -49,7 +48,10 @@ docker-compose up -d
version: '3'
services:
frontend:
image: ghcr.io/se-buw/fm-playground-frontend:latest
build:
context: ./frontend
args:
VITE_FMP_API_URL: http://localhost:8000/api
container_name: fmp-frontend
env_file:
- .env
Expand All @@ -60,7 +62,8 @@ services:
restart: unless-stopped

backend:
image: ghcr.io/se-buw/fm-playground-backend:latest
build:
context: ./backend
container_name: fmp-backend
env_file:
- .env
Expand Down Expand Up @@ -93,56 +96,19 @@ services:
- my_network
restart: unless-stopped

# Alloy API
api:
alloy-api:
build:
context: ./alloy-app/api/
context: ./alloy-api
container_name: fmp-alloy-api
ports:
- "8080:8080"
networks:
- my_network
restart: unless-stopped

# Database for alloy
mongo:
image: mongo:4.4.6
container_name: fmp-mongo
command: mongod --storageEngine=wiredTiger
volumes:
- mongo_data:/data/db
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
networks:
- my_network
restart: unless-stopped

# Alloy application with meteor
meteor:
build:
context: ./alloy-app/meteor/
container_name: fmp-alloy-app
environment:
MONGO_URL: ${MONGO_URL}
METEOR_SETTINGS: ${METEOR_SETTINGS}
STARTUP_DELAY: ${STARTUP_DELAY}
depends_on:
- backend
- postgres
- mongo
links:
- mongo
- api
networks:
- my_network
restart: unless-stopped

volumes:
postgres_data:
mongo_data:

networks:
my_network:
Expand Down
7 changes: 2 additions & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ RUN apt-get install openjdk-17-jdk -y
RUN pip install --no-cache-dir --upgrade pip setuptools
RUN pip install --no-cache-dir -r requirements.txt

RUN chmod +x ./install_nuxmv.sh
RUN sed -i -e 's/\r$//' install_nuxmv.sh
RUN sed -i -e 's/\r$//' install_nuxmv.sh entrypoint.sh
RUN chmod +x ./install_nuxmv.sh ./entrypoint.sh
RUN ./install_nuxmv.sh
RUN mkdir logs


EXPOSE 8000

RUN chmod a+x ./entrypoint.sh
ENTRYPOINT [ "./entrypoint.sh" ]
49 changes: 8 additions & 41 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
version: '3'
services:
frontend:
image: ghcr.io/se-buw/fm-playground-frontend:latest
build:
context: ./frontend
args:
VITE_FMP_API_URL: http://localhost:8000/api
container_name: fmp-frontend
env_file:
- .env
Expand All @@ -12,7 +15,8 @@ services:
restart: unless-stopped

backend:
image: ghcr.io/se-buw/fm-playground-backend:latest
build:
context: ./backend
container_name: fmp-backend
env_file:
- .env
Expand Down Expand Up @@ -45,56 +49,19 @@ services:
- my_network
restart: unless-stopped

# Alloy API
api:
alloy-api:
build:
context: ./alloy-app/api/
context: ./alloy-api
container_name: fmp-alloy-api
ports:
- "8080:8080"
networks:
- my_network
restart: unless-stopped

# Database for alloy
mongo:
image: mongo:4.4.6
container_name: fmp-mongo
command: mongod --storageEngine=wiredTiger
volumes:
- mongo_data:/data/db
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
networks:
- my_network
restart: unless-stopped

# Alloy application with meteor
meteor:
build:
context: ./alloy-app/meteor/
container_name: fmp-alloy-app
environment:
MONGO_URL: ${MONGO_URL}
METEOR_SETTINGS: ${METEOR_SETTINGS}
STARTUP_DELAY: ${STARTUP_DELAY}
depends_on:
- backend
- postgres
- mongo
links:
- mongo
- api
networks:
- my_network
restart: unless-stopped

volumes:
postgres_data:
mongo_data:

networks:
my_network:
Expand Down
7 changes: 2 additions & 5 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
FROM node:20-alpine
ARG VITE_FMP_API_URL
ENV VITE_FMP_API_URL=$VITE_FMP_API_URL

WORKDIR /app

COPY package.json .
RUN npm install

COPY . .

RUN npm run build

EXPOSE 5173

CMD ["npm", "run", "preview"]

0 comments on commit 469415b

Please sign in to comment.