Commit f7436bb7 authored by Ahmad Anvari's avatar Ahmad Anvari

Dockerize app

parent c8644f53
Pipeline #888 failed with stages
# Use an official Python runtime as a parent image
FROM python:3.6
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt
# Make port 80 available to the world outside this container
EXPOSE 80
# Define environment variable
ENV NAME World
# Run app.py when the container launches
CMD ["python", "app.py"]
...@@ -2,4 +2,4 @@ from app import app ...@@ -2,4 +2,4 @@ from app import app
if __name__ == '__main__': if __name__ == '__main__':
app.run() app.run(host="0.0.0.0", port=80)
version: '3'
services:
app:
build: .
ports:
- 80:80
environment:
- MONGO_HOST=mongo
- MONGO_PORT=27017
mongo:
image: mongo:4.2.0
volumes:
- /var/lib/mongodb/data:/data/db
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment