Help with dealing with S3 uploads in a mixed development/production environment

Starting to feel really guilty about the number of docker related questions I am posing but at @George’s suggestion I finally decided to get to grips with S3 file storage/ uploads via D.O. spaces.

The process is fairly painless and got uploads working very easily

However I am a bit confused how this works in relation to development/production targets

My design methodology is that I am running is a development environment with Docker local and I use DO/ Docker for production.

I am using the standard upload process with Put File as I have lots of uploads to convert and this rouite makes the process faster

In testing i add dummy data within the development target, test fully then deploy the new code to Production. I do not want that test data deployed to the production server.

However now I am using DO spaces/ S3 uploads, then i upload test images in the development environment they are uploaded to the production “spaces” container which I don’t want.

How do I deal with that, I was kind of expecting docker local would create a “parallel” space or something similar as a test environment.

How can i test in development and not contaminate production with test images

1 Like

Sorry, found this which I think is the solution

Yes indeed as Jon points out, you use a different bucket for development and production.

quick question if i may george.

When using spaces, what settings do i input in the project settings for uploads?

image

Guess these will be redundant

Just my spaces name is “imageuploads” but when doing an upload via put i see the path is:

No idea where the “test” but comes from

but the file correctly uploads to the root of the DO space

image

result

Project assets settings doesn’t matter and aren’t used when you use S3 uploads, then you manage it your self.

Further more see:

worked it out now, my bad, up far to early this morning

Yes this works fine, except for the fact that Wappler sets the environment to ‘production’ on staging targets too.

got the uploads working but still struggling to set paths dependent on environment
Everything is currently going into the bucket root

Put the environment variable in the Key field of the S3 Put File properties to include the correct folder in the upload path Ben:
image

2 Likes

Thank you so much, so easy when you know how. You have made a really bad day a little better
Really appreciate that help

1 Like