Fixed some auth stuff and deployment stuff #7
							
								
								
									
										10
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -91,17 +91,17 @@ COPY --from=backend-builder /usr/local/cargo/bin/sqlx /usr/local/bin/sqlx | ||||
| # Copy migrations for database setup | ||||
| COPY --from=backend-builder /app/backend/migrations /migrations | ||||
|  | ||||
| # Copy existing database if it exists (optional - migrations will create if needed) | ||||
| COPY --from=backend-builder /app/backend/calendar.db /calendar.db 2>/dev/null || true | ||||
|  | ||||
| # Create startup script to copy frontend files, run migrations, and start backend | ||||
| RUN mkdir -p /srv/www | ||||
| RUN mkdir -p /srv/www /db | ||||
| RUN echo '#!/bin/sh' > /usr/local/bin/start.sh && \ | ||||
|     echo 'echo "Copying frontend files..."' >> /usr/local/bin/start.sh && \ | ||||
|     echo 'cp -r /app/frontend-dist/* /srv/www/' >> /usr/local/bin/start.sh && \ | ||||
|     echo 'echo "Ensuring database directory exists..."' >> /usr/local/bin/start.sh && \ | ||||
|     echo 'mkdir -p /db && chmod 755 /db' >> /usr/local/bin/start.sh && \ | ||||
|     echo 'echo "Running database migrations..."' >> /usr/local/bin/start.sh && \ | ||||
|     echo 'sqlx migrate run --database-url "sqlite:/calendar.db" --source /migrations || echo "Migration failed but continuing..."' >> /usr/local/bin/start.sh && \ | ||||
|     echo 'sqlx migrate run --database-url "sqlite:/db/calendar.db" --source /migrations || echo "Migration failed but continuing..."' >> /usr/local/bin/start.sh && \ | ||||
|     echo 'echo "Starting backend server..."' >> /usr/local/bin/start.sh && \ | ||||
|     echo 'export DATABASE_URL="sqlite:/db/calendar.db"' >> /usr/local/bin/start.sh && \ | ||||
|     echo '/usr/local/bin/backend' >> /usr/local/bin/start.sh && \ | ||||
|     chmod +x /usr/local/bin/start.sh | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user