0

I am able to deploy docker on app engine for flask application. Dockerfile looks like below:

FROM python:3.7-slim
LABEL maintainer = "Prasad Dalavi prasad01dalavi@gmail.com"
COPY . .
RUN pip3 install -r requirements.txt
EXPOSE 8080
ENTRYPOINT ["python3", "main.py"]

and app.yaml like below:

runtime: custom
env: flex

when I create directories in flask static folder, I want to map them to gcp bucket. What exactly I need to do. I took reference of following link but could not understand.

Docker build failing when using gcsfuse to mount google storage

They are mounting the volume. I wanted to bind it like

docker run -d -v gcp_bucket:container_directory -p 8080:8080 docker_image
Prasad
  • 1,028
  • 1
  • 11
  • 22

1 Answers1

0

I would recommend you against this, App Engine is different from GKE due to the way it uses to manage the containers and the permissions it grants the user when creating them through the Docker file.

The only really "viable" way to mount the bucket would be to manually do so inside the instance once it is running which would be something very difficult once App Engine starts scaling.

rsalinas
  • 1,507
  • 8
  • 9
  • Thanks for your recommendation rsalinas! In that case, If I create directories in binded volumes in container, will those directories be reflected and persisted in bucket? – Prasad Jan 03 '20 at 16:54
  • If you mount the bucket on the instance and then create a file, yes, it should be reflected. Nevertheless, as mentioned you would have to mount the bucket manually on each container so I would not recommend doing this. – rsalinas Jan 10 '20 at 08:59